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

Unified Diff: components/sync/model_impl/shared_model_type_processor_unittest.cc

Issue 2630613002: [Sync] USS: Filter out tombstones for initial sync. (Closed)
Patch Set: Fix TestEntryFactory for realz. Created 3 years, 11 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 | « components/sync/model_impl/shared_model_type_processor.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/model_impl/shared_model_type_processor_unittest.cc
diff --git a/components/sync/model_impl/shared_model_type_processor_unittest.cc b/components/sync/model_impl/shared_model_type_processor_unittest.cc
index ed58b826f831838e6ecab42a6e642abe1fe6316e..76b406595017c7202617b1a0267178dcfba65ad1 100644
--- a/components/sync/model_impl/shared_model_type_processor_unittest.cc
+++ b/components/sync/model_impl/shared_model_type_processor_unittest.cc
@@ -305,6 +305,24 @@ TEST_F(SharedModelTypeProcessorTest, InitialSync) {
worker()->ExpectPendingCommits({kHash1});
}
+// Test that an initial sync filters out tombstones in the processor.
+TEST_F(SharedModelTypeProcessorTest, InitialSyncWithTombstone) {
+ OnMetadataLoaded();
+ OnSyncStarting();
+
+ EXPECT_EQ(0, bridge()->merge_call_count());
+ // Initial sync with a tombstone. The fake bridge checks that it doesn't get
+ // any tombstones in its MergeSyncData function.
+ worker()->TombstoneFromServer(kHash1);
+ EXPECT_EQ(1, bridge()->merge_call_count());
+
+ // Should still have no data, metadata, or commit requests.
+ EXPECT_EQ(0U, db().data_count());
+ EXPECT_EQ(0U, db().metadata_count());
+ EXPECT_EQ(0U, ProcessorEntityCount());
+ EXPECT_EQ(0U, worker()->GetNumPendingCommits());
+}
+
// Test that subsequent starts don't call MergeSyncData.
TEST_F(SharedModelTypeProcessorTest, NonInitialSync) {
// This sets initial_sync_done to true.
« no previous file with comments | « components/sync/model_impl/shared_model_type_processor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698