Index: chrome/browser/sync/profile_sync_service_unittest.cc |
diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc |
index 78ac1f42c12ffe15ba6d1a0b7f57e0ce81c40780..1a2fe90cbe7d9470732d7bb7c286e64aaa8aa700 100644 |
--- a/chrome/browser/sync/profile_sync_service_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc |
@@ -389,6 +389,7 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIds) { |
EXPECT_CALL(observer, OnNotificationsDisabled( |
syncer::TRANSIENT_NOTIFICATION_ERROR)); |
+ service_->RegisterInvalidationHandler(&observer); |
service_->UpdateRegisteredInvalidationIds(&observer, ids); |
SyncBackendHostForProfileSyncTest* const backend = |
@@ -400,7 +401,7 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIds) { |
Mock::VerifyAndClearExpectations(&observer); |
- service_->UpdateRegisteredInvalidationIds(&observer, syncer::ObjectIdSet()); |
+ service_->UnregisterInvalidationHandler(&observer); |
backend->EmitOnNotificationsEnabled(); |
backend->EmitOnIncomingNotification(payloads, syncer::REMOTE_NOTIFICATION); |
@@ -422,9 +423,12 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIdsPersistence) { |
EXPECT_CALL(observer, OnNotificationsEnabled()); |
EXPECT_CALL(observer, OnIncomingNotification( |
payloads, syncer::REMOTE_NOTIFICATION)); |
+ // This may get called more than once, as a real notifier is |
+ // created. |
EXPECT_CALL(observer, OnNotificationsDisabled( |
- syncer::TRANSIENT_NOTIFICATION_ERROR)); |
+ syncer::TRANSIENT_NOTIFICATION_ERROR)).Times(AtLeast(1)); |
+ service_->RegisterInvalidationHandler(&observer); |
service_->UpdateRegisteredInvalidationIds(&observer, ids); |
service_->StopAndSuppress(); |