Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 297693002: Tests for "WebView: speed up user gesture notification for GestureTap" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Limit test to Aura Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/password/form_and_link.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager_browsertest.cc
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc
index 1c3de2fa8bf49344a1fc93f312a721ab4a6dfd2e..bc888d4835cef99d83cb24280251d1c436da7d8d 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -33,6 +33,7 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
#include "ui/events/keycodes/keyboard_codes.h"
+#include "ui/gfx/geometry/point.h"
// NavigationObserver ---------------------------------------------------------
@@ -639,6 +640,40 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
CheckScriptReturnValue(check_password, true);
}
+// The following test is limited to Aura, because
+// RenderWidgetHostViewGuest::ProcessAckedTouchEvent is, and
+// ProcessAckedTouchEvent is what triggers the translation of touch events to
+// gesture events.
+#if defined(USE_AURA)
+IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
+ PasswordValueAccessibleOnSubmit) {
+ NavigateToFile("/password/form_and_link.html");
+
+ // Fill in the credentials, and make sure they are saved.
+ NavigationObserver form_submit_observer(WebContents());
+ std::string fill_and_submit =
+ "document.getElementById('username_field').value = 'temp';"
+ "document.getElementById('password_field').value = 'random_secret';"
+ "document.getElementById('input_submit_button').click();";
+ ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
+ form_submit_observer.Wait();
+ EXPECT_TRUE(form_submit_observer.infobar_shown());
+
+ // Reload the original page to have the saved credentials autofilled.
+ NavigationObserver reload_observer(WebContents());
+ NavigateToFile("/password/form_and_link.html");
+ reload_observer.Wait();
+
+ NavigationObserver submit_observer(WebContents());
+ // Submit the form via a tap on the submit button. The button is placed at 0,
+ // 100, and has height 300 and width 700.
+ content::SimulateTapAt(WebContents(), gfx::Point(350, 250));
+ submit_observer.Wait();
+ std::string query = WebContents()->GetURL().query();
+ EXPECT_NE(std::string::npos, query.find("random_secret")) << query;
+}
+#endif
+
// Test fix for crbug.com/338650.
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
DontPromptForPasswordFormWithDefaultValue) {
« no previous file with comments | « no previous file | chrome/test/data/password/form_and_link.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698