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

Unified Diff: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc

Issue 2878813002: Trigger protected password entry request on password reuse event. (Closed)
Patch Set: nit Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
diff --git a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
index 814931ae7467820efa4cc18d4a11996403433a4c..8aeeb662f0c7c6595138a4de65507c197fdac83b 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client_unittest.cc
@@ -87,6 +87,8 @@ class MockPasswordProtectionService
MOCK_METHOD0(IsHistorySyncEnabled, bool());
MOCK_METHOD3(MaybeStartPasswordFieldOnFocusRequest,
void(const GURL&, const GURL&, const GURL&));
+ MOCK_METHOD2(MaybeStartProtectedPasswordEntryRequest,
+ void(const GURL&, const std::string&));
private:
DISALLOW_COPY_AND_ASSIGN(MockPasswordProtectionService);
@@ -622,4 +624,18 @@ TEST_F(ChromePasswordManagerClientTest,
client->CheckSafeBrowsingReputation(GURL("http://foo.com/submit"),
GURL("http://foo.com/iframe.html"));
}
+
+TEST_F(ChromePasswordManagerClientTest,
+ VerifyMaybeProtectedPasswordEntryRequestCalled) {
+ std::unique_ptr<WebContents> test_web_contents(
+ content::WebContentsTester::CreateTestWebContents(
+ web_contents()->GetBrowserContext(), nullptr));
+ std::unique_ptr<MockChromePasswordManagerClient> client(
+ new MockChromePasswordManagerClient(test_web_contents.get()));
+ EXPECT_CALL(*client->password_protection_service(),
+ MaybeStartProtectedPasswordEntryRequest(_, _))
+ .Times(1);
+ client->CheckProtectedPasswordEntry(std::string("saved_domain.com"));
+}
+
#endif

Powered by Google App Engine
This is Rietveld 408576698