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

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

Issue 2189513004: Blink: prevent didAssociateFormControls notification while parsing the document. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename Created 4 years, 5 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/base/chrome_render_view_test.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 5b767ba404606cb4cecb3eaeb36f52dd6e6fbebe..49ca26d8144535559fb4071140dba5ea093a4321 100644
--- a/chrome/browser/password_manager/password_manager_browsertest.cc
+++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -205,6 +205,28 @@ IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
}
IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
+ NoPromptIfPasswordFormManagerDestroyed) {
+ NavigateToFile("/password/password_form.html");
+ // Simulate the Credential Manager API essentially destroying all the
+ // PasswordFormManager instances.
+ ChromePasswordManagerClient::FromWebContents(WebContents())
+ ->NotifyStorePasswordCalled();
+
+ // Fill a form and submit through a <input type="submit"> button. The renderer
+ // should not send "PasswordFormsParsed" messages after the page was loaded.
+ NavigationObserver observer(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();
+ std::unique_ptr<BubbleObserver> prompt_observer(
+ new BubbleObserver(WebContents()));
+ EXPECT_FALSE(prompt_observer->IsShowingSavePrompt());
+}
+
+IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase,
PromptForSubmitWithInPageNavigation) {
NavigateToFile("/password/password_navigate_before_submit.html");
« no previous file with comments | « no previous file | chrome/test/base/chrome_render_view_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698