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 43ee1fb7a43f88db0c967136cadb1b6d86f2f225..fede8a503b9c19688c5ef63225feeec865e4ff03 100644 |
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc |
@@ -185,22 +185,20 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { |
service_->Initialize(); |
MessageLoop::current()->Run(); |
- // Only set the passphrase if we actually created the password and nigori |
- // root nodes. |
- if (root_task) { |
- EXPECT_CALL(observer_, |
- Observe( |
- NotificationType(NotificationType::SYNC_PASSPHRASE_ACCEPTED), |
- _,_)). |
- WillOnce(InvokeTask(node_task)); |
- EXPECT_CALL(observer_, |
- Observe( |
- NotificationType(NotificationType::SYNC_CONFIGURE_DONE), |
- _,_)). |
- WillOnce(QuitUIMessageLoop()); |
- service_->SetPassphrase("foo"); |
- MessageLoop::current()->Run(); |
- } |
+ |
+ EXPECT_CALL(observer_, |
+ Observe( |
+ NotificationType(NotificationType::SYNC_PASSPHRASE_ACCEPTED), |
+ _,_)). |
+ WillOnce(InvokeTask(node_task)); |
+ EXPECT_CALL(observer_, |
+ Observe( |
+ NotificationType(NotificationType::SYNC_CONFIGURE_DONE), |
+ _,_)). |
+ WillOnce(QuitUIMessageLoop()); |
+ service_->SetPassphrase("foo"); |
+ MessageLoop::current()->Run(); |
+ |
} |
} |
@@ -270,22 +268,6 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { |
scoped_refptr<MockPasswordStore> password_store_; |
NotificationRegistrar registrar_; |
- TestIdFactory ids_; |
-}; |
- |
-class CreatePasswordRootTask : public Task { |
- public: |
- explicit CreatePasswordRootTask(AbstractProfileSyncServiceTest* test) |
- : test_(test) { |
- } |
- |
- virtual void Run() { |
- test_->CreateRoot(syncable::NIGORI); |
- test_->CreateRoot(syncable::PASSWORDS); |
- } |
- |
- private: |
- AbstractProfileSyncServiceTest* test_; |
}; |
class AddPasswordEntriesTask : public Task { |
@@ -307,10 +289,7 @@ class AddPasswordEntriesTask : public Task { |
}; |
TEST_F(ProfileSyncServicePasswordTest, FailModelAssociation) { |
- // Create the nigori root node so that password model association is |
- // attempted, but not the password root node so that it fails. |
- CreateRootTask task(this, syncable::NIGORI); |
- StartSyncService(&task, NULL, 1, 2); |
+ StartSyncService(NULL, NULL, 1, 2); |
EXPECT_TRUE(service_->unrecoverable_error_detected()); |
} |
@@ -320,7 +299,7 @@ TEST_F(ProfileSyncServicePasswordTest, EmptyNativeEmptySync) { |
EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
.WillOnce(Return(true)); |
SetIdleChangeProcessorExpectations(); |
- CreatePasswordRootTask task(this); |
+ CreateRootTask task(this, syncable::PASSWORDS); |
StartSyncService(&task, NULL); |
std::vector<PasswordForm> sync_entries; |
GetPasswordEntriesFromSyncDB(&sync_entries); |
@@ -350,7 +329,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeEntriesEmptySync) { |
EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
.WillOnce(Return(true)); |
SetIdleChangeProcessorExpectations(); |
- CreatePasswordRootTask task(this); |
+ CreateRootTask task(this, syncable::PASSWORDS); |
StartSyncService(&task, NULL); |
std::vector<PasswordForm> sync_forms; |
GetPasswordEntriesFromSyncDB(&sync_forms); |
@@ -402,7 +381,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeEntriesEmptySyncSameUsername) { |
EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) |
.WillOnce(Return(true)); |
SetIdleChangeProcessorExpectations(); |
- CreatePasswordRootTask task(this); |
+ CreateRootTask task(this, syncable::PASSWORDS); |
StartSyncService(&task, NULL); |
std::vector<PasswordForm> sync_forms; |
GetPasswordEntriesFromSyncDB(&sync_forms); |
@@ -457,7 +436,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeHasSyncNoMerge) { |
EXPECT_CALL(*password_store_, FillBlacklistLogins(_)).WillOnce(Return(true)); |
EXPECT_CALL(*password_store_, AddLoginImpl(_)).Times(1); |
- CreatePasswordRootTask root_task(this); |
+ CreateRootTask root_task(this, syncable::PASSWORDS); |
AddPasswordEntriesTask node_task(this, sync_forms); |
StartSyncService(&root_task, &node_task); |
@@ -530,7 +509,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeHasSyncMergeEntry) { |
EXPECT_CALL(*password_store_, FillBlacklistLogins(_)).WillOnce(Return(true)); |
EXPECT_CALL(*password_store_, UpdateLoginImpl(_)).Times(1); |
- CreatePasswordRootTask root_task(this); |
+ CreateRootTask root_task(this, syncable::PASSWORDS); |
AddPasswordEntriesTask node_task(this, sync_forms); |
StartSyncService(&root_task, &node_task); |