summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--third_party/WebKit/Source/web/WebViewImpl.cpp1
-rw-r--r--third_party/WebKit/Source/web/tests/WebViewTest.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 7beee47..16dba7f 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -2391,6 +2391,7 @@ bool WebViewImpl::confirmComposition(ConfirmCompositionBehavior selectionBehavio
bool WebViewImpl::confirmComposition(const WebString& text)
{
+ UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
return confirmComposition(text, DoNotKeepSelection);
}
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index 9871232..06116e6 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -3232,4 +3232,19 @@ TEST_F(WebViewTest, WebSubstringUtil)
}
#endif
+TEST_F(WebViewTest, PasswordFieldEditingIsUserGesture)
+{
+ URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), WebString::fromUTF8("input_field_password.html"));
+ MockAutofillClient client;
+ WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "input_field_password.html", true);
+ WebLocalFrameImpl* frame = toWebLocalFrameImpl(webView->mainFrame());
+ frame->setAutofillClient(&client);
+ webView->setInitialFocus(false);
+
+ EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hello").c_str())));
+ EXPECT_EQ(1, client.textChangesFromUserGesture());
+ EXPECT_FALSE(UserGestureIndicator::processingUserGesture());
+ frame->setAutofillClient(0);
+}
+
} // namespace blink