Chromium Code Reviews| 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()); |
| +} |