Commit b39df3c9 authored by gcasto's avatar gcasto Committed by Commit bot

[Password Manager] Disable autofilling for testing password websites

BUG=415166

Review URL: https://codereview.chromium.org/604563003

Cr-Commit-Position: refs/heads/master@{#296830}
parent 987f416b
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "google_apis/gaia/gaia_urls.h" #include "google_apis/gaia/gaia_urls.h"
#include "net/base/url_util.h" #include "net/base/url_util.h"
#include "third_party/re2/re2/re2.h"
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "chrome/browser/android/password_authentication_manager.h" #include "chrome/browser/android/password_authentication_manager.h"
...@@ -488,8 +489,11 @@ bool ChromePasswordManagerClient::IsURLPasswordWebsiteReauth( ...@@ -488,8 +489,11 @@ bool ChromePasswordManagerClient::IsURLPasswordWebsiteReauth(
if (!net::GetValueForKeyInQuery(url, "continue", &param_value)) if (!net::GetValueForKeyInQuery(url, "continue", &param_value))
return false; return false;
return GURL(param_value).host() == // All password sites, including test sites, have autofilling disabled.
GURL(chrome::kPasswordManagerAccountDashboardURL).host(); CR_DEFINE_STATIC_LOCAL(RE2, account_dashboard_pattern,
("passwords(-([a-z]+\\.corp))?\\.google\\.com"));
return RE2::FullMatch(GURL(param_value).host(), account_dashboard_pattern);
} }
bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() { bool ChromePasswordManagerClient::IsTheHotNewBubbleUIEnabled() {
......
...@@ -298,6 +298,12 @@ TEST_F(ChromePasswordManagerClientTest, ...@@ -298,6 +298,12 @@ TEST_F(ChromePasswordManagerClientTest,
"https://passwords.%67oogle.com/settings&rart=123")); "https://passwords.%67oogle.com/settings&rart=123"));
EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage()); EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage());
// Make sure testing sites are disabled as well.
NavigateAndCommit(
GURL("https://accounts.google.com/Login?continue="
"https://passwords-testing.corp.google.com/settings&rart=456"));
EXPECT_FALSE(client->IsPasswordManagerEnabledForCurrentPage());
// Fully qualified domain name is considered a different hostname by GURL. // Fully qualified domain name is considered a different hostname by GURL.
// Ideally this would not be the case, but this quirk can be avoided by // Ideally this would not be the case, but this quirk can be avoided by
// verification on the server. This test is simply documentation of this // verification on the server. This test is simply documentation of this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment