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

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: Remove now-unneeded param 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 e5c3b94704fb8257f5b678bf3f1dc51de0e015e8..e74626dae26a133cbd1652a413c2ba4e6a29dbd3 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, OnIncomingNotification(
payloads, syncer::REMOTE_NOTIFICATION));
- 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->EmitOnNotificationsDisabled(syncer::TRANSIENT_NOTIFICATION_ERROR);
@@ -418,7 +421,8 @@ TEST_F(ProfileSyncServiceTest, UpdateRegisteredInvalidationIdsPersistence) {
syncer::ObjectIdSet ids;
ids.insert(invalidation::ObjectId(3, "id3"));
- 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