Source/web/tests/WebViewTest.cpp
// Check that the WebAutofillClient is correctly notified about first user
// gestures after load, following various input events.
Check that the WebAutofillClient is correctly notified about first user
gestures after load, following various input events.
Check that the WebAutofillClient is correctly notified about first user gestures after load following various input events .
TEST_F(WebViewTest, FirstUserGestureObservedKeyEvent)
{
    URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("form.html"));
    MockAutofillClient client;
    WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true);
    webView->setAutofillClient(&client);
    webView->setInitialFocus(false);
    EXPECT_EQ(0, client.getUserGestureNotificationsCount());
    WebKeyboardEvent keyEvent;
    keyEvent.windowsKeyCode = WebCore::VKEY_SPACE;
    keyEvent.type = WebInputEvent::RawKeyDown;
    keyEvent.setKeyIdentifierFromWindowsKeyCode();
    webView->handleInputEvent(keyEvent);
    keyEvent.type = WebInputEvent::KeyUp;
    webView->handleInputEvent(keyEvent);
    EXPECT_EQ(1, client.getUserGestureNotificationsCount());
    webView->setAutofillClient(0);
}
TEST_F ( WebViewTest , FirstUserGestureObservedKeyEvent ) { URLTestHelpers :: registerMockedURLFromBaseURL ( WebString :: fromUTF8 ( m_baseURL . c_str ( ) ) , WebString :: fromUTF8 ( " " ) ) ; MockAutofillClient client ; WebView * webView = m_webViewHelper . initializeAndLoad ( m_baseURL + " " , true ) ; webView -> setAutofillClient ( & client ) ; webView -> setInitialFocus ( false ) ; EXPECT_EQ ( 0 , client . getUserGestureNotificationsCount ( ) ) ; WebKeyboardEvent keyEvent ; keyEvent . windowsKeyCode = WebCore :: VKEY_SPACE ; keyEvent . type = WebInputEvent :: RawKeyDown ; keyEvent . setKeyIdentifierFromWindowsKeyCode ( ) ; webView -> handleInputEvent ( keyEvent ) ; keyEvent . type = WebInputEvent :: KeyUp ; webView -> handleInputEvent ( keyEvent ) ; EXPECT_EQ ( 1 , client . getUserGestureNotificationsCount ( ) ) ; webView -> setAutofillClient ( 0 ) ; }
Check that the WebAutofillClient is correctly notified about first user
gestures after load, following various input events.
Check that the WebAutofillClient is correctly notified about first user gestures after load following various input events .