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

Side by Side Diff: chrome/browser/password_manager/native_backend_gnome_x_unittest.cc

Issue 2664763002: Only apply federated matches on HTTPS (Closed)
Patch Set: Fix Subdomain. Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_libsecret_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdarg.h> 5 #include <stdarg.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 TEST_F(NativeBackendGnomeTest, PSLUpdatingStrictUpdateLogin) { 879 TEST_F(NativeBackendGnomeTest, PSLUpdatingStrictUpdateLogin) {
880 CheckPSLUpdate(UPDATE_BY_UPDATELOGIN); 880 CheckPSLUpdate(UPDATE_BY_UPDATELOGIN);
881 } 881 }
882 882
883 TEST_F(NativeBackendGnomeTest, PSLUpdatingStrictAddLogin) { 883 TEST_F(NativeBackendGnomeTest, PSLUpdatingStrictAddLogin) {
884 // TODO(vabr): if AddLogin becomes no longer valid for existing logins, then 884 // TODO(vabr): if AddLogin becomes no longer valid for existing logins, then
885 // just delete this test. 885 // just delete this test.
886 CheckPSLUpdate(UPDATE_BY_ADDLOGIN); 886 CheckPSLUpdate(UPDATE_BY_ADDLOGIN);
887 } 887 }
888 888
889 TEST_F(NativeBackendGnomeTest, FetchFederatedCredential) { 889 TEST_F(NativeBackendGnomeTest, FetchFederatedCredentialOnHTTPS) {
890 other_auth_.signon_realm = "federation://www.example.com/google.com"; 890 other_auth_.signon_realm = "federation://www.example.com/google.com";
891 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 891 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
892 EXPECT_TRUE(CheckCredentialAvailability(other_auth_, 892 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
893 GURL("http://www.example.com/"), 893 GURL("https://www.example.com/"),
894 PasswordForm::SCHEME_HTML, nullptr)); 894 PasswordForm::SCHEME_HTML, nullptr));
895 } 895 }
896 896
897 TEST_F(NativeBackendGnomeTest, DontFetchFederatedCredentialOnHTTP) {
898 other_auth_.signon_realm = "federation://www.example.com/google.com";
899 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
900 EXPECT_FALSE(CheckCredentialAvailability(other_auth_,
901 GURL("http://www.example.com/"),
902 PasswordForm::SCHEME_HTML, nullptr));
903 }
904
897 TEST_F(NativeBackendGnomeTest, FetchPSLMatchedFederatedCredentialOnHTTPS) { 905 TEST_F(NativeBackendGnomeTest, FetchPSLMatchedFederatedCredentialOnHTTPS) {
898 other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; 906 other_auth_.signon_realm = "federation://www.sub.example.com/google.com";
899 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 907 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
900 EXPECT_TRUE(CheckCredentialAvailability(other_auth_, 908 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
901 GURL("https://www.example.com/"), 909 GURL("https://www.example.com/"),
902 PasswordForm::SCHEME_HTML, nullptr)); 910 PasswordForm::SCHEME_HTML, nullptr));
903 } 911 }
904 912
905 TEST_F(NativeBackendGnomeTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) { 913 TEST_F(NativeBackendGnomeTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) {
906 other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; 914 other_auth_.signon_realm = "federation://www.sub.example.com/google.com";
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 base::Bind(&CheckTrue)); 1325 base::Bind(&CheckTrue));
1318 1326
1319 RunBothThreads(); 1327 RunBothThreads();
1320 1328
1321 EXPECT_EQ(2u, form_list.size()); 1329 EXPECT_EQ(2u, form_list.size());
1322 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), 1330 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_),
1323 Pointee(form_facebook_))); 1331 Pointee(form_facebook_)));
1324 } 1332 }
1325 1333
1326 // TODO(mdm): add more basic tests here at some point. 1334 // TODO(mdm): add more basic tests here at some point.
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_libsecret_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698