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

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

Issue 2816033002: Fix retrieving federated credentials for the password store for localhost. (Closed)
Patch Set: comments Created 3 years, 8 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
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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, FetchFederatedCredentialOnHTTPS) { 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_.origin = GURL("https://www.example.com/");
891 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 892 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
892 EXPECT_TRUE(CheckCredentialAvailability(other_auth_, 893 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
893 GURL("https://www.example.com/"), 894 GURL("https://www.example.com/"),
894 PasswordForm::SCHEME_HTML, nullptr)); 895 PasswordForm::SCHEME_HTML, nullptr));
895 } 896 }
896 897
898 TEST_F(NativeBackendGnomeTest, FetchFederatedCredentialOnLocalhost) {
899 other_auth_.signon_realm = "federation://localhost/google.com";
900 other_auth_.origin = GURL("http://localhost:8080/");
901 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
902 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
903 GURL("http://localhost:8080/"),
904 PasswordForm::SCHEME_HTML, nullptr));
905 }
906
897 TEST_F(NativeBackendGnomeTest, DontFetchFederatedCredentialOnHTTP) { 907 TEST_F(NativeBackendGnomeTest, DontFetchFederatedCredentialOnHTTP) {
898 other_auth_.signon_realm = "federation://www.example.com/google.com"; 908 other_auth_.signon_realm = "federation://www.example.com/google.com";
909 other_auth_.origin = GURL("https://www.example.com/");
899 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 910 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
900 EXPECT_FALSE(CheckCredentialAvailability(other_auth_, 911 EXPECT_FALSE(CheckCredentialAvailability(other_auth_,
901 GURL("http://www.example.com/"), 912 GURL("http://www.example.com/"),
902 PasswordForm::SCHEME_HTML, nullptr)); 913 PasswordForm::SCHEME_HTML, nullptr));
903 } 914 }
904 915
905 TEST_F(NativeBackendGnomeTest, FetchPSLMatchedFederatedCredentialOnHTTPS) { 916 TEST_F(NativeBackendGnomeTest, FetchPSLMatchedFederatedCredentialOnHTTPS) {
906 other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; 917 other_auth_.signon_realm = "federation://www.sub.example.com/google.com";
918 other_auth_.origin = GURL("https://www.sub.example.com/");
907 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 919 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
908 EXPECT_TRUE(CheckCredentialAvailability(other_auth_, 920 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
909 GURL("https://www.example.com/"), 921 GURL("https://www.example.com/"),
910 PasswordForm::SCHEME_HTML, nullptr)); 922 PasswordForm::SCHEME_HTML, nullptr));
911 } 923 }
912 924
913 TEST_F(NativeBackendGnomeTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) { 925 TEST_F(NativeBackendGnomeTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) {
914 other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; 926 other_auth_.signon_realm = "federation://www.sub.example.com/google.com";
927 other_auth_.origin = GURL("https://www.sub.example.com/");
915 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 928 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
916 EXPECT_FALSE(CheckCredentialAvailability(other_auth_, 929 EXPECT_FALSE(CheckCredentialAvailability(other_auth_,
917 GURL("http://www.example.com/"), 930 GURL("http://www.example.com/"),
918 PasswordForm::SCHEME_HTML, nullptr)); 931 PasswordForm::SCHEME_HTML, nullptr));
919 } 932 }
920 933
921 TEST_F(NativeBackendGnomeTest, BasicUpdateLogin) { 934 TEST_F(NativeBackendGnomeTest, BasicUpdateLogin) {
922 NativeBackendGnome backend(42); 935 NativeBackendGnome backend(42);
923 backend.Init(); 936 backend.Init();
924 937
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 base::Bind(&CheckTrue)); 1338 base::Bind(&CheckTrue));
1326 1339
1327 RunBothThreads(); 1340 RunBothThreads();
1328 1341
1329 EXPECT_EQ(2u, form_list.size()); 1342 EXPECT_EQ(2u, form_list.size());
1330 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), 1343 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_),
1331 Pointee(form_facebook_))); 1344 Pointee(form_facebook_)));
1332 } 1345 }
1333 1346
1334 // TODO(mdm): add more basic tests here at some point. 1347 // TODO(mdm): add more basic tests here at some point.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698