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

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: Address a couple of spots i missed 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
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 0925cc2827c8d762f721cc2464dd9079ee1b42c9..8ae155158b20250778313c2f0cf30b351fc0d296 100644
--- a/chrome/browser/sync/profile_sync_service_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_unittest.cc
@@ -46,6 +46,8 @@ using testing::Mock;
using testing::Return;
using testing::StrictMock;
+const char kHandlerName[] = "MockObserver";
+
class ProfileSyncServiceTest : public testing::Test {
protected:
ProfileSyncServiceTest()
@@ -389,7 +391,8 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIds) {
EXPECT_CALL(observer, OnNotificationsDisabled(
syncer::TRANSIENT_NOTIFICATION_ERROR));
- service_->UpdateRegisteredInvalidationIds(&observer, ids);
+ service_->SetInvalidationHandler(kHandlerName, &observer);
+ service_->UpdateRegisteredInvalidationIds(kHandlerName, ids);
SyncBackendHostForProfileSyncTest* const backend =
service_->GetBackendForTest();
@@ -400,7 +403,7 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIds) {
Mock::VerifyAndClearExpectations(&observer);
- service_->UpdateRegisteredInvalidationIds(&observer, syncer::ObjectIdSet());
+ service_->SetInvalidationHandler(kHandlerName, NULL);
backend->EmitOnNotificationsEnabled();
backend->EmitOnIncomingNotification(payloads, syncer::REMOTE_NOTIFICATION);
@@ -425,7 +428,8 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIdsPersistence) {
EXPECT_CALL(observer, OnNotificationsDisabled(
syncer::TRANSIENT_NOTIFICATION_ERROR));
- service_->UpdateRegisteredInvalidationIds(&observer, ids);
+ service_->SetInvalidationHandler(kHandlerName, &observer);
+ service_->UpdateRegisteredInvalidationIds(kHandlerName, ids);
service_->StopAndSuppress();
service_->UnsuppressAndStart();

Powered by Google App Engine
This is Rietveld 408576698