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

Unified Diff: chrome/renderer/autofill/password_autofill_agent_browsertest.cc

Issue 2716873002: More robust fill password fields on click. (Closed)
Patch Set: Update comment Created 3 years, 10 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 | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/autofill/password_autofill_agent_browsertest.cc
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
index 182010fd278dfaa949dfb5fd33cb9668c24b5bc5..b598bccc4fcb37a6a5a88c990ed3e5e10b49855d 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -2516,4 +2516,25 @@ TEST_F(PasswordAutofillAgentTest, ShowAutofillSignaturesFlag) {
}
}
+// Tests that a suggestion dropdown is shown even if JavaScripts updated field
+// names.
+TEST_F(PasswordAutofillAgentTest, SuggestWhenJavaScriptUpdatesFieldNames) {
+ // Simulate that JavaScript updated field names.
+ auto fill_data = fill_data_;
+ fill_data.username_field.name += ASCIIToUTF16("1");
+ fill_data.password_field.name += ASCIIToUTF16("1");
+ // Simulate the browser sending back the login info.
+ SimulateOnFillPasswordForm(fill_data);
+
+ // Call SimulateElementClick() to produce a user gesture on the page so
+ // autofill will actually fill.
+ SimulateElementClick(kUsernameName);
+
+ // Simulate a user clicking on the password element. This should produce a
+ // dropdown with suggestion of all available usernames.
+ static_cast<PageClickListener*>(autofill_agent_)
+ ->FormControlElementClicked(password_element_, false);
+ CheckSuggestions("", false);
+}
+
} // namespace autofill
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698