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

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

Issue 733953002: Do not save passwords if the landing page has HTTP status 5xx or 4xx (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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/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 f0a766f8a1ffc5f005168db5200bd4e9e1fd6b2d..ae0d1bf10b8dca53bf5fdd612069827ebaa7920e 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -871,6 +871,24 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
EXPECT_FALSE(prompt_observer->IsShowingPrompt());
}
+IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest,
+ NoPromptForLandingPageWithHTTPErrorStatusCode) {
+ // Check that no prompt is shown for forms where the landing page has
+ // HTTP status 404.
+ NavigateToFile("/password/password_form.html");
+
+ NavigationObserver observer(WebContents());
+ scoped_ptr<PromptObserver> prompt_observer(
+ PromptObserver::Create(WebContents()));
+ std::string fill_and_submit =
+ "document.getElementById('username_field_http_error').value = 'temp';"
+ "document.getElementById('password_field_http_error').value = 'random';"
+ "document.getElementById('input_submit_button_http_error').click()";
+ ASSERT_TRUE(content::ExecuteScript(RenderViewHost(), fill_and_submit));
+ observer.Wait();
+ EXPECT_FALSE(prompt_observer->IsShowingPrompt());
+}
+
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTest, DeleteFrameBeforeSubmit) {
NavigateToFile("/password/multi_frames.html");

Powered by Google App Engine
This is Rietveld 408576698