Index: chrome/browser/sync/profile_sync_service_password_unittest.cc |
=================================================================== |
--- chrome/browser/sync/profile_sync_service_password_unittest.cc (revision 71392) |
+++ chrome/browser/sync/profile_sync_service_password_unittest.cc (working copy) |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
+1;2c// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -178,22 +178,20 @@ |
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", false, true); |
- 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", false, true); |
+ MessageLoop::current()->Run(); |
} |
} |
@@ -263,24 +261,8 @@ |
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 { |
public: |
AddPasswordEntriesTask(ProfileSyncServicePasswordTest* test, |
@@ -300,10 +282,7 @@ |
}; |
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()); |
} |
@@ -313,7 +292,7 @@ |
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); |
@@ -343,7 +322,7 @@ |
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); |
@@ -395,7 +374,7 @@ |
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); |
@@ -450,7 +429,7 @@ |
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); |
@@ -523,7 +502,7 @@ |
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); |