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

Unified Diff: chrome/browser/sync/glue/sync_backend_host_unittest.cc

Issue 13197004: Draft: InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes tests Created 7 years, 8 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/glue/sync_backend_host_unittest.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
index 96d1acb380cfb624af92f4a48d14113bf5d8b140..17907a8a7f1eb9a5a7eb4fe171c744d67b333d42 100644
--- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
@@ -151,8 +151,7 @@ class SyncBackendHostTest : public testing::Test {
backend_.reset(new SyncBackendHost(
profile_->GetDebugName(),
profile_.get(),
- sync_prefs_->AsWeakPtr(),
- invalidator_storage_->AsWeakPtr()));
+ sync_prefs_->AsWeakPtr()));
credentials_.email = "user@example.com";
credentials_.sync_token = "sync_token";
@@ -591,76 +590,6 @@ TEST_F(SyncBackendHostTest, NewlySupportedTypesWithPartialTypes) {
enabled_types_).Empty());
}
-// Register for some IDs and trigger an invalidation. This should
-// propagate all the way to the frontend.
-TEST_F(SyncBackendHostTest, Invalidate) {
- InitializeBackend(true);
-
- syncer::ObjectIdSet ids;
- ids.insert(invalidation::ObjectId(1, "id1"));
- ids.insert(invalidation::ObjectId(2, "id2"));
- const syncer::ObjectIdInvalidationMap& invalidation_map =
- syncer::ObjectIdSetToInvalidationMap(ids, "payload");
-
- EXPECT_CALL(
- mock_frontend_,
- OnIncomingInvalidation(invalidation_map))
- .WillOnce(InvokeWithoutArgs(QuitMessageLoop));
-
- backend_->UpdateRegisteredInvalidationIds(ids);
- fake_manager_->Invalidate(invalidation_map);
- ui_loop_.PostDelayedTask(
- FROM_HERE, ui_loop_.QuitClosure(), TestTimeouts::action_timeout());
- ui_loop_.Run();
-}
-
-// Register for some IDs and update the invalidator state. This
-// should propagate all the way to the frontend.
-TEST_F(SyncBackendHostTest, UpdateInvalidatorState) {
- InitializeBackend(true);
-
- EXPECT_CALL(mock_frontend_,
- OnInvalidatorStateChange(syncer::INVALIDATIONS_ENABLED))
- .WillOnce(InvokeWithoutArgs(QuitMessageLoop));
-
- syncer::ObjectIdSet ids;
- ids.insert(invalidation::ObjectId(3, "id3"));
- backend_->UpdateRegisteredInvalidationIds(ids);
- fake_manager_->UpdateInvalidatorState(syncer::INVALIDATIONS_ENABLED);
- ui_loop_.PostDelayedTask(
- FROM_HERE, ui_loop_.QuitClosure(), TestTimeouts::action_timeout());
- ui_loop_.Run();
-}
-
-// Call StopSyncingForShutdown() on the backend and fire some invalidations
-// before calling Shutdown(). Then start up and shut down the backend again.
-// Those notifications shouldn't propagate to the frontend.
-TEST_F(SyncBackendHostTest, InvalidationsAfterStopSyncingForShutdown) {
- InitializeBackend(true);
-
- syncer::ObjectIdSet ids;
- ids.insert(invalidation::ObjectId(5, "id5"));
- backend_->UpdateRegisteredInvalidationIds(ids);
-
- backend_->StopSyncingForShutdown();
-
- // Should not trigger anything.
- fake_manager_->UpdateInvalidatorState(syncer::TRANSIENT_INVALIDATION_ERROR);
- fake_manager_->UpdateInvalidatorState(syncer::INVALIDATIONS_ENABLED);
- const syncer::ObjectIdInvalidationMap& invalidation_map =
- syncer::ObjectIdSetToInvalidationMap(ids, "payload");
- fake_manager_->Invalidate(invalidation_map);
-
- // Make sure the above calls take effect before we continue.
- fake_manager_->WaitForSyncThread();
-
- backend_->Shutdown(false);
- backend_.reset();
-
- TearDown();
- SetUp();
-}
-
// Ensure the device info tracker is initialized properly on startup.
TEST_F(SyncBackendHostTest, InitializeDeviceInfo) {
ASSERT_EQ(NULL, backend_->GetSyncedDeviceTracker());

Powered by Google App Engine
This is Rietveld 408576698