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

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

Issue 83023017: Basic autofill into password value on user gesture only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits from gcasto Created 7 years 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/renderer/autofill/password_autofill_agent_browsertest.cc » ('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 66f53d85af039812bdf168808bfa5d568b39dcf5..ee3c7e0a9f2739226623f571a31acf8920939785 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -342,6 +342,11 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
// Now navigate to a login form that has similar HTML markup.
NavigateToFile("/password/password_form.html");
+ // Simulate a user click to force an autofill of the form's DOM value, not
+ // just the suggested value.
+ std::string click = "document.getElementById('testform_no_name').click()";
+ ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), click));
+
// The form should be filled with the previously submitted username.
std::string get_username =
"window.domAutomationController.send("
@@ -367,6 +372,7 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
base::HistogramBase* upload_histogram =
base::StatisticsRecorder::FindHistogram(
"PasswordGeneration.UploadStarted");
+ ASSERT_TRUE(upload_histogram);
scoped_ptr<base::HistogramSamples> snapshot =
upload_histogram->SnapshotSamples();
EXPECT_EQ(0, snapshot->GetCount(0 /* failure */));
« no previous file with comments | « no previous file | chrome/renderer/autofill/password_autofill_agent_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698