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

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

Issue 293093002: Don't show "Save password" prompt for a failed login (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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/renderer/autofill/password_autofill_agent_browsertest.cc » ('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 56df5ad7d902fd05cb7c0de4fc8c220375c27f73..7e378892be743824d2d968bb6967ffbaba526fa2 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -487,6 +487,45 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
}
}
+IN_PROC_BROWSER_TEST_F(
+ PasswordManagerBrowserTest,
+ NoPromptForFailedLoginFromMainFrameWithMultiFramesInPage) {
+ NavigateToFile("/password/multi_frames.html");
+
+ // Make sure that we don't prompt to save the password for a failed login
+ // from the main frame with multiple frames in the same page.
+ NavigationObserver observer(WebContents());
+ std::string fill_and_submit =
+ "document.getElementById('username_failed').value = 'temp';"
+ "document.getElementById('password_failed').value = 'random';"
+ "document.getElementById('submit_failed').click();";
+
+ ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
+ observer.Wait();
+ EXPECT_FALSE(observer.infobar_shown());
+}
+
+IN_PROC_BROWSER_TEST_F(
+ PasswordManagerBrowserTest,
+ NoPromptForFailedLoginFromSubFrameWithMultiFramesInPage) {
+ NavigateToFile("/password/multi_frames.html");
+
+ // Make sure that we don't prompt to save the password for a failed login
+ // from a sub-frame with multiple frames in the same page.
+ NavigationObserver observer(WebContents());
+ std::string fill_and_submit =
+ "var first_frame = document.getElementById('first_frame');"
+ "var frame_doc = first_frame.contentDocument;"
+ "frame_doc.getElementById('username_failed').value = 'temp';"
+ "frame_doc.getElementById('password_failed').value = 'random';"
+ "frame_doc.getElementById('submit_failed').click();"
+ "window.parent.location.href = 'multi_frames.html';";
+
+ ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
+ observer.Wait();
+ EXPECT_FALSE(observer.infobar_shown());
+}
+
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
PromptForXHRSubmit) {
#if defined(OS_WIN) && defined(USE_ASH)
« no previous file with comments | « no previous file | chrome/renderer/autofill/password_autofill_agent_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698