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

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

Issue 497233003: [Password Manager] Disable password manager for password website reauth (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 6 years, 4 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/chrome_password_manager_client_unittest.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
index 802bdcef1797161c2ab75ee008efb0b534f841b8..1c7a77b60d2bd465b3d30cd614d8b3b171293c77 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -266,3 +266,29 @@ TEST_F(ChromePasswordManagerClientTest, ShouldFilterAutofillResult) {
NavigateAndCommit(GURL("https://accounts.google.com/Login"));
EXPECT_TRUE(client->ShouldFilterAutofillResult(form));
}
+
+TEST_F(ChromePasswordManagerClientTest,
+ IsPasswordManagerEnabledForCurrentPage) {
Mike West 2014/08/24 05:37:57 Can you add some clever bypass checks? Things that
Garrett Casto 2014/08/25 08:16:49 Added some. Interestingly a trailing dot is consid
+ ChromePasswordManagerClient* client = GetClient();
+ NavigateAndCommit(
+ GURL("https://accounts.google.com/ServiceLogin?continue="
+ "https://passwords.google.com/settings&rart=123"));
+ EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage());
+
+ NavigateAndCommit(
+ GURL("https://accounts.google.com/ServiceLogin?continue="
+ "https://passwords.google.com/settings"));
+ EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage());
+
+ // Should be enabled for other transactional reauth pages.
+ NavigateAndCommit(
+ GURL("https://accounts.google.com/ServiceLogin?continue="
+ "https://mail.google.com&rart=234"));
+ EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage());
+
+ // Reauth pages are only on accounts.google.com
+ NavigateAndCommit(
+ GURL("https://other.site.com/ServiceLogin?continue="
+ "https://passwords.google.com&rart=234"));
+ EXPECT_TRUE(client->IsPasswordManagerEnabledForCurrentPage());
+}

Powered by Google App Engine
This is Rietveld 408576698