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

Unified Diff: chrome/browser/sync/profile_sync_service_password_unittest.cc

Issue 2828021: Take 2: sync changes to support encryption (Closed)
Patch Set: fix flaky password test under valgrind Created 10 years, 6 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/protocol/password_specifics.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b54bfb23b3b801afa230682cb674f93bc4fa1d1b..b70457805c04a75d7c746f0783f99d669af7fd9d 100644
--- a/chrome/browser/sync/profile_sync_service_password_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc
@@ -144,12 +144,21 @@ class ProfileSyncServicePasswordTest : public testing::Test {
// State changes once for the backend init and once for startup done.
EXPECT_CALL(observer_, OnStateChanged()).
- WillOnce(InvokeTask(task)).
+ WillOnce(Return()).
WillOnce(Return()).
WillOnce(QuitUIMessageLoop());
+
service_->RegisterDataTypeController(data_type_controller);
service_->Initialize();
MessageLoop::current()->Run();
+
+ EXPECT_CALL(observer_, OnStateChanged()).
+ WillOnce(InvokeTask(task)).
+ WillOnce(Return()).
+ WillOnce(QuitUIMessageLoop());
+
+ service_->SetPassphrase("foo");
+ MessageLoop::current()->Run();
}
}
@@ -203,8 +212,8 @@ class ProfileSyncServicePasswordTest : public testing::Test {
sync_api::ReadNode child_node(&trans);
ASSERT_TRUE(child_node.InitByIdLookup(child_id));
- sync_pb::PasswordSpecificsData password;
- ASSERT_TRUE(child_node.GetPasswordSpecifics(&password));
+ const sync_pb::PasswordSpecificsData& password =
+ child_node.GetPasswordSpecifics();
PasswordForm form;
PasswordModelAssociator::CopyPassword(password, &form);
@@ -290,8 +299,8 @@ class AddPasswordEntriesTask : public Task {
TEST_F(ProfileSyncServicePasswordTest, FailModelAssociation) {
// Backend will be paused but not resumed.
EXPECT_CALL(backend_, RequestPause()).
- WillOnce(testing::DoAll(Notify(NotificationType::SYNC_PAUSED),
- testing::Return(true)));
+ WillRepeatedly(testing::DoAll(Notify(NotificationType::SYNC_PAUSED),
+ testing::Return(true)));
// Don't create the root password node so startup fails.
StartSyncService(NULL);
EXPECT_TRUE(service_->unrecoverable_error_detected());
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/protocol/password_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698