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

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

Issue 2652243002: Implement Federated PSL Matches in Native Backends (Closed)
Patch Set: Addressed comments. 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
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 } 694 }
695 695
696 TEST_F(NativeBackendLibsecretTest, FetchFederatedCredential) { 696 TEST_F(NativeBackendLibsecretTest, FetchFederatedCredential) {
697 other_auth_.signon_realm = "federation://www.example.com/google.com"; 697 other_auth_.signon_realm = "federation://www.example.com/google.com";
698 other_auth_.federation_origin = url::Origin(GURL("https://google.com/")); 698 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
699 EXPECT_TRUE(CheckCredentialAvailability(other_auth_, 699 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
700 GURL("http://www.example.com/"), 700 GURL("http://www.example.com/"),
701 PasswordForm::SCHEME_HTML, nullptr)); 701 PasswordForm::SCHEME_HTML, nullptr));
702 } 702 }
703 703
704 TEST_F(NativeBackendLibsecretTest, FetchPSLMatchedFederatedCredentialOnHTTPS) {
705 other_auth_.signon_realm = "federation://www.example.com/google.com";
706 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
707 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
708 GURL("https://www.example.com/"),
709 PasswordForm::SCHEME_HTML, nullptr));
710 }
711
712 TEST_F(NativeBackendLibsecretTest,
713 DontFetchPSLMatchedFederatedCredentialOnHTTP) {
714 other_auth_.signon_realm = "federation://www.example.com/google.com";
715 other_auth_.federation_origin = url::Origin(GURL("https://google.com/"));
716 EXPECT_TRUE(CheckCredentialAvailability(other_auth_,
717 GURL("http://www.example.com/"),
718 PasswordForm::SCHEME_HTML, nullptr));
719 }
720
704 TEST_F(NativeBackendLibsecretTest, BasicUpdateLogin) { 721 TEST_F(NativeBackendLibsecretTest, BasicUpdateLogin) {
705 NativeBackendLibsecret backend(42); 722 NativeBackendLibsecret backend(42);
706 723
707 VerifiedAdd(&backend, form_google_); 724 VerifiedAdd(&backend, form_google_);
708 725
709 PasswordForm new_form_google(form_google_); 726 PasswordForm new_form_google(form_google_);
710 new_form_google.times_used = 1; 727 new_form_google.times_used = 1;
711 new_form_google.action = GURL("http://www.google.com/different/login"); 728 new_form_google.action = GURL("http://www.google.com/different/login");
712 729
713 EXPECT_EQ(1u, global_mock_libsecret_items->size()); 730 EXPECT_EQ(1u, global_mock_libsecret_items->size());
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
976 EXPECT_EQ(form_google_, *form_list[0]); 993 EXPECT_EQ(form_google_, *form_list[0]);
977 994
978 EXPECT_EQ(1u, global_mock_libsecret_items->size()); 995 EXPECT_EQ(1u, global_mock_libsecret_items->size());
979 if (!global_mock_libsecret_items->empty()) { 996 if (!global_mock_libsecret_items->empty()) {
980 CheckMockSecretItem((*global_mock_libsecret_items)[0].get(), form_google_, 997 CheckMockSecretItem((*global_mock_libsecret_items)[0].get(), form_google_,
981 "chrome-42"); 998 "chrome-42");
982 } 999 }
983 } 1000 }
984 1001
985 // TODO(mdm): add more basic tests here at some point. 1002 // TODO(mdm): add more basic tests here at some point.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698