| OLD | NEW |
| 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 } | 887 } |
| 888 | 888 |
| 889 TEST_F(NativeBackendGnomeTest, FetchFederatedCredential) { | 889 TEST_F(NativeBackendGnomeTest, FetchFederatedCredential) { |
| 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("http://www.example.com/"), |
| 894 PasswordForm::SCHEME_HTML, nullptr)); | 894 PasswordForm::SCHEME_HTML, nullptr)); |
| 895 } | 895 } |
| 896 | 896 |
| 897 TEST_F(NativeBackendGnomeTest, FetchPSLMatchedFederatedCredentialOnHTTPS) { |
| 898 other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; |
| 899 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); |
| 900 EXPECT_TRUE(CheckCredentialAvailability(other_auth_, |
| 901 GURL("https://www.example.com/"), |
| 902 PasswordForm::SCHEME_HTML, nullptr)); |
| 903 } |
| 904 |
| 905 TEST_F(NativeBackendGnomeTest, DontFetchPSLMatchedFederatedCredentialOnHTTP) { |
| 906 other_auth_.signon_realm = "federation://www.sub.example.com/google.com"; |
| 907 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); |
| 908 EXPECT_FALSE(CheckCredentialAvailability(other_auth_, |
| 909 GURL("http://www.example.com/"), |
| 910 PasswordForm::SCHEME_HTML, nullptr)); |
| 911 } |
| 912 |
| 897 TEST_F(NativeBackendGnomeTest, BasicUpdateLogin) { | 913 TEST_F(NativeBackendGnomeTest, BasicUpdateLogin) { |
| 898 NativeBackendGnome backend(42); | 914 NativeBackendGnome backend(42); |
| 899 backend.Init(); | 915 backend.Init(); |
| 900 | 916 |
| 901 // First add google login. | 917 // First add google login. |
| 902 BrowserThread::PostTask( | 918 BrowserThread::PostTask( |
| 903 BrowserThread::DB, FROM_HERE, | 919 BrowserThread::DB, FROM_HERE, |
| 904 base::Bind(base::IgnoreResult(&NativeBackendGnome::AddLogin), | 920 base::Bind(base::IgnoreResult(&NativeBackendGnome::AddLogin), |
| 905 base::Unretained(&backend), form_google_)); | 921 base::Unretained(&backend), form_google_)); |
| 906 | 922 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1301 base::Bind(&CheckTrue)); | 1317 base::Bind(&CheckTrue)); |
| 1302 | 1318 |
| 1303 RunBothThreads(); | 1319 RunBothThreads(); |
| 1304 | 1320 |
| 1305 EXPECT_EQ(2u, form_list.size()); | 1321 EXPECT_EQ(2u, form_list.size()); |
| 1306 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), | 1322 EXPECT_THAT(form_list, UnorderedElementsAre(Pointee(form_google_), |
| 1307 Pointee(form_facebook_))); | 1323 Pointee(form_facebook_))); |
| 1308 } | 1324 } |
| 1309 | 1325 |
| 1310 // TODO(mdm): add more basic tests here at some point. | 1326 // TODO(mdm): add more basic tests here at some point. |
| OLD | NEW |