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

Unified Diff: chrome/browser/password_manager/password_manager_browsertest.cc

Issue 1072813002: Avoid considering readonly password elements in password form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatted comment length to contain within 80 chars 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 | chrome/test/data/password/password_form_with_password_readonly.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/password_manager_browsertest.cc
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc
index 892ac14147fc894dcd05946fc6e03163f499cc8c..7670572e74b42ff2db7e86bf7c20bf8420ad99ad 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -1189,6 +1189,24 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
+ DontPromptForPasswordFormWithReadonlyPasswordField) {
+ NavigateToFile("/password/password_form_with_password_readonly.html");
+
+ // Fill a form and submit through a <input type="submit"> button. Nothing
+ // special.
+ NavigationObserver observer(WebContents());
+ scoped_ptr<PromptObserver> prompt_observer(
+ PromptObserver::Create(WebContents()));
+ std::string fill_and_submit =
+ "document.getElementById('username_field').value = 'temp';"
+ "document.getElementById('password_field').value = 'random';"
+ "document.getElementById('input_submit_button').click()";
+ ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
+ observer.Wait();
+ EXPECT_FALSE(prompt_observer->IsShowingPrompt());
+}
+
+IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
PromptWhenEnableAutomaticPasswordSavingSwitchIsNotSet) {
NavigateToFile("/password/password_form.html");
« no previous file with comments | « no previous file | chrome/test/data/password/password_form_with_password_readonly.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698