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

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

Issue 2900983002: Ignore form action URL when determine if a credential should be autofilled. (Closed)
Patch Set: comments and tests 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
Index: chrome/browser/password_manager/credential_manager_browsertest.cc
diff --git a/chrome/browser/password_manager/credential_manager_browsertest.cc b/chrome/browser/password_manager/credential_manager_browsertest.cc
index f7adf75218c4b48c390792a5969c1045bf7dbb18..f33470ed1a9c5dbc5b503a20f16e33f01cda07bc 100644
--- a/chrome/browser/password_manager/credential_manager_browsertest.cc
+++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -336,4 +336,23 @@ IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, UpdateViaAPIAndAutofill) {
EXPECT_EQ(signin_form, stored[signin_form.signon_realm][0]);
}
+IN_PROC_BROWSER_TEST_F(CredentialManagerBrowserTest, CredentialsAutofilled) {
+ NavigateToFile("/password/password_form.html");
+
+ ASSERT_TRUE(content::ExecuteScript(
+ RenderFrameHost(),
+ "var c = new PasswordCredential({ id: 'user', password: '12345' });"
+ "navigator.credentials.store(c);"));
+ BubbleObserver bubble_observer(WebContents());
+ bubble_observer.WaitForSavePrompt();
+ bubble_observer.AcceptSavePrompt();
+
+ // Reload the page and make sure it's autofilled.
+ NavigateToFile("/password/password_form.html");
+ WaitForElementValue("username_field", "user");
+ content::SimulateMouseClickAt(
+ WebContents(), 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(1, 1));
+ WaitForElementValue("password_field", "12345");
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698