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

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

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Work around brittle unit test Created 8 years, 4 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') | sync/internal_api/public/sync_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | sync/internal_api/public/sync_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698