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

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

Issue 662493002: [Password Generation] Enable generation for dynamically created forms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Better Created 6 years, 2 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/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_generation_agent_browsertest.cc
diff --git a/chrome/renderer/autofill/password_generation_agent_browsertest.cc b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
index e19951333c734e0523615bc6824792b0db899bc7..1e85b948b33f42c5a1c8cf6b6c72dbe875c318de 100644
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -343,4 +343,34 @@ TEST_F(PasswordGenerationAgentTest, MaximumOfferSize) {
1);
}
+TEST_F(PasswordGenerationAgentTest, DynamicFormTest) {
+ LoadHTML(kSigninFormHTML);
+ SetNotBlacklistedMessage(kSigninFormHTML);
+ SetAccountCreationFormsDetectedMessage(kSigninFormHTML);
+
+ ExecuteJavaScript(
+ "var form = document.createElement('form');"
+ "var username = document.createElement('input');"
+ "username.type = 'text';"
+ "username.id = 'dynamic_username';"
+ "var first_password = document.createElement('input');"
+ "first_password.type = 'password';"
+ "first_password.id = 'first_password';"
+ "first_password.name = 'first_password';"
+ "var second_password = document.createElement('input');"
+ "second_password.type = 'password';"
+ "second_password.id = 'second_password';"
+ "second_password.name = 'second_password';"
+ "form.appendChild(username);"
+ "form.appendChild(first_password);"
+ "form.appendChild(second_password);"
+ "document.body.appendChild(form);");
+ ProcessPendingMessages();
+ // TODO(gcasto): I'm slighty worried about flakes in this test where
+ // didAssociateFormControls() isn't called. If this turns out to be a problem
+ // adding a call to OnDynamicFormsSeen(GetMainFrame()) will fix it, though
+ // it will weaken the test.
+ ExpectPasswordGenerationAvailable("first_password", true);
+}
+
} // namespace autofill
« no previous file with comments | « no previous file | components/autofill/content/renderer/autofill_agent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698