Index: chrome/browser/sync/profile_sync_service_password_unittest.cc |
diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc |
index a5fd446b97901b2178bf2313bf3235cf707c53d4..e7d61baffc8886d1bcf4dbe49a019f7d8f5dc9cf 100644 |
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc |
@@ -178,7 +178,7 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { |
} |
virtual void TearDown() { |
- if (password_store_) |
+ if (password_store_.get()) |
password_store_->ShutdownOnUIThread(); |
ProfileSyncServiceFactory::GetInstance()->SetTestingFactory( |
&profile_, NULL); |
@@ -227,12 +227,11 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { |
sync_service_); |
ProfileSyncComponentsFactoryMock* components = |
sync_service_->components_factory_mock(); |
- if (password_store_) { |
- EXPECT_CALL(*components, CreatePasswordSyncComponents(_, _, _)). |
- Times(AtLeast(1)). // Can be more if we hit NEEDS_CRYPTO. |
- WillRepeatedly(MakePasswordSyncComponents(sync_service_, |
- password_store_.get(), |
- data_type_controller)); |
+ if (password_store_.get()) { |
+ EXPECT_CALL(*components, CreatePasswordSyncComponents(_, _, _)) |
+ .Times(AtLeast(1)). // Can be more if we hit NEEDS_CRYPTO. |
+ WillRepeatedly(MakePasswordSyncComponents( |
+ sync_service_, password_store_.get(), data_type_controller)); |
} else { |
// When the password store is unavailable, password sync components must |
// not be created. |
@@ -320,9 +319,9 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { |
} |
void SetIdleChangeProcessorExpectations() { |
- EXPECT_CALL(*password_store_, AddLoginImpl(_)).Times(0); |
- EXPECT_CALL(*password_store_, UpdateLoginImpl(_)).Times(0); |
- EXPECT_CALL(*password_store_, RemoveLoginImpl(_)).Times(0); |
+ EXPECT_CALL(*password_store_.get(), AddLoginImpl(_)).Times(0); |
+ EXPECT_CALL(*password_store_.get(), UpdateLoginImpl(_)).Times(0); |
+ EXPECT_CALL(*password_store_.get(), RemoveLoginImpl(_)).Times(0); |
} |
content::MockNotificationObserver observer_; |
@@ -377,9 +376,9 @@ TEST_F(ProfileSyncServicePasswordTest, MAYBE_FailPasswordStoreLoad) { |
} |
TEST_F(ProfileSyncServicePasswordTest, MAYBE_EmptyNativeEmptySync) { |
- EXPECT_CALL(*password_store_, FillAutofillableLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillAutofillableLogins(_)) |
.WillOnce(Return(true)); |
- EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillBlacklistLogins(_)) |
.WillOnce(Return(true)); |
SetIdleChangeProcessorExpectations(); |
CreateRootHelper create_root(this, syncer::PASSWORDS); |
@@ -407,9 +406,9 @@ TEST_F(ProfileSyncServicePasswordTest, MAYBE_HasNativeEntriesEmptySync) { |
new_form->blacklisted_by_user = false; |
forms.push_back(new_form); |
expected_forms.push_back(*new_form); |
- EXPECT_CALL(*password_store_, FillAutofillableLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillAutofillableLogins(_)) |
.WillOnce(DoAll(SetArgumentPointee<0>(forms), Return(true))); |
- EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillBlacklistLogins(_)) |
.WillOnce(Return(true)); |
SetIdleChangeProcessorExpectations(); |
CreateRootHelper create_root(this, syncer::PASSWORDS); |
@@ -460,9 +459,9 @@ TEST_F(ProfileSyncServicePasswordTest, |
expected_forms.push_back(*new_form); |
} |
- EXPECT_CALL(*password_store_, FillAutofillableLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillAutofillableLogins(_)) |
.WillOnce(DoAll(SetArgumentPointee<0>(forms), Return(true))); |
- EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillBlacklistLogins(_)) |
.WillOnce(Return(true)); |
SetIdleChangeProcessorExpectations(); |
CreateRootHelper create_root(this, syncer::PASSWORDS); |
@@ -515,10 +514,11 @@ TEST_F(ProfileSyncServicePasswordTest, MAYBE_HasNativeHasSyncNoMerge) { |
expected_forms.push_back(new_form); |
} |
- EXPECT_CALL(*password_store_, FillAutofillableLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillAutofillableLogins(_)) |
.WillOnce(DoAll(SetArgumentPointee<0>(native_forms), Return(true))); |
- EXPECT_CALL(*password_store_, FillBlacklistLogins(_)).WillOnce(Return(true)); |
- EXPECT_CALL(*password_store_, AddLoginImpl(_)).Times(1); |
+ EXPECT_CALL(*password_store_.get(), FillBlacklistLogins(_)) |
+ .WillOnce(Return(true)); |
+ EXPECT_CALL(*password_store_.get(), AddLoginImpl(_)).Times(1); |
CreateRootHelper create_root(this, syncer::PASSWORDS); |
StartSyncService(create_root.callback(), |
@@ -575,14 +575,13 @@ TEST_F(ProfileSyncServicePasswordTest, MAYBE_EnsureNoTransactions) { |
expected_forms.push_back(new_form); |
} |
- EXPECT_CALL(*password_store_, FillAutofillableLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillAutofillableLogins(_)) |
.WillOnce(DoAll(SetArgumentPointee<0>(native_forms), |
AcquireSyncTransaction(this), |
Return(true))); |
- EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
- .WillOnce(DoAll(AcquireSyncTransaction(this), |
- Return(true))); |
- EXPECT_CALL(*password_store_, AddLoginImpl(_)) |
+ EXPECT_CALL(*password_store_.get(), FillBlacklistLogins(_)) |
+ .WillOnce(DoAll(AcquireSyncTransaction(this), Return(true))); |
+ EXPECT_CALL(*password_store_.get(), AddLoginImpl(_)) |
.WillOnce(AcquireSyncTransaction(this)); |
CreateRootHelper create_root(this, syncer::PASSWORDS); |
@@ -653,10 +652,11 @@ TEST_F(ProfileSyncServicePasswordTest, MAYBE_HasNativeHasSyncMergeEntry) { |
expected_forms.push_back(new_form); |
} |
- EXPECT_CALL(*password_store_, FillAutofillableLogins(_)) |
+ EXPECT_CALL(*password_store_.get(), FillAutofillableLogins(_)) |
.WillOnce(DoAll(SetArgumentPointee<0>(native_forms), Return(true))); |
- EXPECT_CALL(*password_store_, FillBlacklistLogins(_)).WillOnce(Return(true)); |
- EXPECT_CALL(*password_store_, UpdateLoginImpl(_)).Times(1); |
+ EXPECT_CALL(*password_store_.get(), FillBlacklistLogins(_)) |
+ .WillOnce(Return(true)); |
+ EXPECT_CALL(*password_store_.get(), UpdateLoginImpl(_)).Times(1); |
CreateRootHelper create_root(this, syncer::PASSWORDS); |
StartSyncService(create_root.callback(), |