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

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: Cleanup 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
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..d974ef7a3ed6edded1ce3a795837a7956dc10966 100644
--- a/chrome/renderer/autofill/password_generation_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_generation_agent_browsertest.cc
@@ -343,4 +343,30 @@ 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();
Garrett Casto 2014/10/15 22:11:45 I'm slightly worried that this might flake because
vabr (Chromium) 2014/10/16 07:46:15 If it does not flake during tryjobs and in the tre
Garrett Casto 2014/10/16 19:14:06 Added a comment. I've run this over 200 times loca
+ ExpectPasswordGenerationAvailable("first_password", true);
+}
+
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698