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

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

Issue 2664763002: Only apply federated matches on HTTPS (Closed)
Patch Set: Fix Subdomain. Created 3 years, 11 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/native_backend_libsecret_unittest.cc
diff --git a/chrome/browser/password_manager/native_backend_libsecret_unittest.cc b/chrome/browser/password_manager/native_backend_libsecret_unittest.cc
index 5c3515eb44c9839eded2b79fed7814baa0294109..220966d8e7bf9aa4b6a3054f68b94a4713165813 100644
--- a/chrome/browser/password_manager/native_backend_libsecret_unittest.cc
+++ b/chrome/browser/password_manager/native_backend_libsecret_unittest.cc
@@ -693,17 +693,25 @@ TEST_F(NativeBackendLibsecretTest, PSLUpdatingStrictAddLogin) {
CheckPSLUpdate(UPDATE_BY_ADDLOGIN);
}
-TEST_F(NativeBackendLibsecretTest, FetchFederatedCredential) {
+TEST_F(NativeBackendLibsecretTest, FetchFederatedCredentialOnHTTPS) {
other_auth_.signon_realm = "federation://www.example.com/google.com";
other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
- GURL("http://www.example.com/"),
+ GURL("https://www.example.com/"),
PasswordForm::SCHEME_HTML, nullptr));
}
-TEST_F(NativeBackendLibsecretTest, FetchPSLMatchedFederatedCredentialOnHTTPS) {
+TEST_F(NativeBackendLibsecretTest, DontFetchFederatedCredentialOnHTTP) {
other_auth_.signon_realm = "federation://www.example.com/google.com";
other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
+ EXPECT_FALSE(CheckCredentialAvailability(other_auth_,
+ GURL("http://www.example.com/"),
+ PasswordForm::SCHEME_HTML, nullptr));
+}
+
+TEST_F(NativeBackendLibsecretTest, FetchPSLMatchedFederatedCredentialOnHTTPS) {
+ other_auth_.signon_realm = "federation://www.sub.example.com/google.com";
+ other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
GURL("https://www.example.com/"),
PasswordForm::SCHEME_HTML, nullptr));
@@ -711,11 +719,11 @@ TEST_F(NativeBackendLibsecretTest, FetchPSLMatchedFederatedCredentialOnHTTPS) {
TEST_F(NativeBackendLibsecretTest,
DontFetchPSLMatchedFederatedCredentialOnHTTP) {
- other_auth_.signon_realm = "federation://www.example.com/google.com";
+ other_auth_.signon_realm = "federation://www.sub.example.com/google.com";
other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
- EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
- GURL("http://www.example.com/"),
- PasswordForm::SCHEME_HTML, nullptr));
+ EXPECT_FALSE(CheckCredentialAvailability(other_auth_,
+ GURL("http://www.example.com/"),
+ PasswordForm::SCHEME_HTML, nullptr));
}
TEST_F(NativeBackendLibsecretTest, BasicUpdateLogin) {

Powered by Google App Engine
This is Rietveld 408576698