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

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

Issue 2929533002: Fill has_password_field for password reuse ping (Closed)
Patch Set: fix broken test due to rebase Created 3 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/password_manager/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 MOCK_METHOD3(FillReferrerChain, 80 MOCK_METHOD3(FillReferrerChain,
81 void(const GURL&, 81 void(const GURL&,
82 int, 82 int,
83 safe_browsing::LoginReputationClientRequest::Frame*)); 83 safe_browsing::LoginReputationClientRequest::Frame*));
84 MOCK_METHOD0(IsExtendedReporting, bool()); 84 MOCK_METHOD0(IsExtendedReporting, bool());
85 MOCK_METHOD0(IsIncognito, bool()); 85 MOCK_METHOD0(IsIncognito, bool());
86 MOCK_METHOD2(IsPingingEnabled, bool(const base::Feature&, RequestOutcome*)); 86 MOCK_METHOD2(IsPingingEnabled, bool(const base::Feature&, RequestOutcome*));
87 MOCK_METHOD0(IsHistorySyncEnabled, bool()); 87 MOCK_METHOD0(IsHistorySyncEnabled, bool());
88 MOCK_METHOD4(MaybeStartPasswordFieldOnFocusRequest, 88 MOCK_METHOD4(MaybeStartPasswordFieldOnFocusRequest,
89 void(WebContents*, const GURL&, const GURL&, const GURL&)); 89 void(WebContents*, const GURL&, const GURL&, const GURL&));
90 MOCK_METHOD3(MaybeStartProtectedPasswordEntryRequest, 90 MOCK_METHOD4(MaybeStartProtectedPasswordEntryRequest,
91 void(WebContents*, const GURL&, const std::string&)); 91 void(WebContents*, const GURL&, const std::string&, bool));
92 MOCK_METHOD3(ShowPhishingInterstitial, 92 MOCK_METHOD3(ShowPhishingInterstitial,
93 void(const GURL&, const std::string&, content::WebContents*)); 93 void(const GURL&, const std::string&, content::WebContents*));
94 94
95 private: 95 private:
96 DISALLOW_COPY_AND_ASSIGN(MockPasswordProtectionService); 96 DISALLOW_COPY_AND_ASSIGN(MockPasswordProtectionService);
97 }; 97 };
98 #endif 98 #endif
99 99
100 // TODO(vabr): Get rid of the mocked client in the client's own test, see 100 // TODO(vabr): Get rid of the mocked client in the client's own test, see
101 // http://crbug.com/474577. 101 // http://crbug.com/474577.
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 } 628 }
629 629
630 TEST_F(ChromePasswordManagerClientTest, 630 TEST_F(ChromePasswordManagerClientTest,
631 VerifyMaybeProtectedPasswordEntryRequestCalled) { 631 VerifyMaybeProtectedPasswordEntryRequestCalled) {
632 std::unique_ptr<WebContents> test_web_contents( 632 std::unique_ptr<WebContents> test_web_contents(
633 content::WebContentsTester::CreateTestWebContents( 633 content::WebContentsTester::CreateTestWebContents(
634 web_contents()->GetBrowserContext(), nullptr)); 634 web_contents()->GetBrowserContext(), nullptr));
635 std::unique_ptr<MockChromePasswordManagerClient> client( 635 std::unique_ptr<MockChromePasswordManagerClient> client(
636 new MockChromePasswordManagerClient(test_web_contents.get())); 636 new MockChromePasswordManagerClient(test_web_contents.get()));
637 EXPECT_CALL(*client->password_protection_service(), 637 EXPECT_CALL(*client->password_protection_service(),
638 MaybeStartProtectedPasswordEntryRequest(_, _, _)) 638 MaybeStartProtectedPasswordEntryRequest(_, _, _, true))
639 .Times(1); 639 .Times(1);
640 client->CheckProtectedPasswordEntry(std::string("saved_domain.com")); 640 client->CheckProtectedPasswordEntry(std::string("saved_domain.com"), true);
641 } 641 }
642 642
643 #endif 643 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698