Index: components/password_manager/core/browser/password_generation_manager_unittest.cc |
diff --git a/components/password_manager/core/browser/password_generation_manager_unittest.cc b/components/password_manager/core/browser/password_generation_manager_unittest.cc |
index 97913e2dfe4bea533c1f6ddb9254c4e22506539e..d01d5f52488cb5534ec8706bbd7c789ca60fe385 100644 |
--- a/components/password_manager/core/browser/password_generation_manager_unittest.cc |
+++ b/components/password_manager/core/browser/password_generation_manager_unittest.cc |
@@ -123,8 +123,8 @@ class PasswordGenerationManagerTest : public testing::Test { |
TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) { |
// Enabling the PasswordManager and password sync should cause generation to |
// be enabled. |
- PrefService* prefs = client_->GetPrefs(); |
- prefs->SetBoolean(prefs::kPasswordManagerSavingEnabled, true); |
+ EXPECT_CALL(*client_, IsSavingEnabledForCurrentPage()) |
+ .WillRepeatedly(testing::Return(true)); |
EXPECT_CALL(*client_, IsPasswordSyncEnabled(_)) |
.WillRepeatedly(testing::Return(true)); |
EXPECT_TRUE(IsGenerationEnabled()); |
@@ -136,7 +136,8 @@ TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) { |
// Disabling the PasswordManager should cause generation to be disabled even |
// if syncing is enabled. |
- prefs->SetBoolean(prefs::kPasswordManagerSavingEnabled, false); |
+ EXPECT_CALL(*client_, IsSavingEnabledForCurrentPage()) |
+ .WillRepeatedly(testing::Return(false)); |
EXPECT_CALL(*client_, IsPasswordSyncEnabled(_)) |
.WillRepeatedly(testing::Return(true)); |
EXPECT_FALSE(IsGenerationEnabled()); |
@@ -144,8 +145,8 @@ TEST_F(PasswordGenerationManagerTest, IsGenerationEnabled) { |
TEST_F(PasswordGenerationManagerTest, DetectAccountCreationForms) { |
// Setup so that IsGenerationEnabled() returns true. |
- PrefService* prefs = client_->GetPrefs(); |
- prefs->SetBoolean(prefs::kPasswordManagerSavingEnabled, true); |
+ EXPECT_CALL(*client_, IsSavingEnabledForCurrentPage()) |
+ .WillRepeatedly(testing::Return(true)); |
EXPECT_CALL(*client_, IsPasswordSyncEnabled(_)) |
.WillRepeatedly(testing::Return(true)); |