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

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

Issue 1088973003: [Password Manager] Relax matching for username overrides. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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_form_conversion_utils.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 beb842f02ca8206d1e71f1d35cfbc03879508290..0b57f447716a7169bddd33a6260e284f8363de31 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -1919,6 +1919,17 @@ TEST_F(PasswordAutofillAgentTest, FindingUsernameWithAutofillPredictions) {
AutofillMsg_AutofillUsernameDataReceived msg(0, predictions);
static_cast<content::RenderFrameObserver*>(password_autofill_agent_)
->OnMessageReceived(msg);
+
+ // The prediction should still match even if the form changes, as long
+ // as the particular element doesn't change.
+ std::string add_field_to_form =
+ "var form = document.getElementById('LoginTestForm');"
+ "var new_input = document.createElement('input');"
+ "new_input.setAttribute('type', 'text');"
+ "new_input.setAttribute('id', 'other_field');"
+ "form.appendChild(new_input);";
+ ExecuteJavaScript(add_field_to_form.c_str());
+
static_cast<content::RenderFrameObserver*>(password_autofill_agent_)
->WillSendSubmitEvent(username_element_.form());
static_cast<content::RenderFrameObserver*>(password_autofill_agent_)
« no previous file with comments | « no previous file | components/autofill/content/renderer/password_form_conversion_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698