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

Unified Diff: components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc

Issue 1031153002: [Credential Management] Smart lock save Credentials bubble should not always pop up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc
diff --git a/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc b/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc
index ba253d96686bf25a1c9d57a5ce79a25538441734..a4dc8040cea309b7c4d79150f19095daef0a94aa 100644
--- a/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc
+++ b/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc
@@ -37,6 +37,7 @@ const int kRequestId = 4;
class MockPasswordManagerClient
: public password_manager::StubPasswordManagerClient {
public:
+ MOCK_CONST_METHOD0(IsSavingEnabledForCurrentPage, bool());
MOCK_CONST_METHOD0(IsOffTheRecord, bool());
MOCK_METHOD1(NotifyUserAutoSigninPtr,
bool(const std::vector<autofill::PasswordForm*>& local_forms));
@@ -161,6 +162,8 @@ class CredentialManagerDispatcherTest
client_.reset(new MockPasswordManagerClient(store_.get()));
dispatcher_.reset(new TestCredentialManagerDispatcher(
web_contents(), client_.get(), &stub_driver_));
+ ON_CALL(*client_, IsSavingEnabledForCurrentPage())
+ .WillByDefault(testing::Return(true));
ON_CALL(*client_, IsOffTheRecord()).WillByDefault(testing::Return(false));
NavigateAndCommit(GURL("https://example.com/test.html"));
@@ -255,9 +258,11 @@ TEST_F(CredentialManagerDispatcherTest, CredentialManagerOnNotifySignedIn) {
EXPECT_EQ(autofill::PasswordForm::SCHEME_HTML, new_form.scheme);
}
-TEST_F(CredentialManagerDispatcherTest, CredentialManagerIncognitoSignedIn) {
+TEST_F(CredentialManagerDispatcherTest,
+ CredentialManagerSignInWithSavingDisabledForCurrentPage) {
CredentialInfo info(form_, CredentialType::CREDENTIAL_TYPE_LOCAL);
- EXPECT_CALL(*client_, IsOffTheRecord()).WillRepeatedly(testing::Return(true));
+ EXPECT_CALL(*client_, IsSavingEnabledForCurrentPage())
+ .WillRepeatedly(testing::Return(false));
EXPECT_CALL(
*client_,
PromptUserToSavePasswordPtr(

Powered by Google App Engine
This is Rietveld 408576698