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

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

Issue 2900713003: [Password Manager, merge to M-59] Make filling robust against changing url by JavaScript. (Closed)
Patch Set: fix merge Created 3 years, 7 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 4b618b0be2427062996015f68d2dca5737469b68..bd33b3020e44148f36edb3461b32a34d99af45a8 100644
--- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
+++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -2712,4 +2712,15 @@ TEST_F(PasswordAutofillAgentTest, InPageNavigationSubmissionUsernameIsEmpty) {
fake_driver_.password_form_inpage_navigation()->password_value);
}
+// Tests that username/password are autofilled when JavaScript is changing url
+// between discovering a form and receving credentials from the browser process.
+TEST_F(PasswordAutofillAgentTest, AutocompleteWhenPageUrlIsChanged) {
+ // Simulate that JavaScript changes url.
+ fill_data_.origin = GURL(fill_data_.origin.possibly_invalid_spec() + "/path");
+
+ SimulateOnFillPasswordForm(fill_data_);
+
+ // The username and password should have been autocompleted.
+ CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true);
+}
} // 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