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

Unified Diff: components/sync/engine_impl/uss_migrator_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/engine_impl/uss_migrator.cc ('k') | components/sync/model/fake_model_type_sync_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/uss_migrator_unittest.cc
diff --git a/components/sync/engine_impl/uss_migrator_unittest.cc b/components/sync/engine_impl/uss_migrator_unittest.cc
index 3d76e43d1186e31658dc8655c73b6bf75cfc4f82..d231fbd4d0ef6a6730e294e1b34de6abe5ed06c2 100644
--- a/components/sync/engine_impl/uss_migrator_unittest.cc
+++ b/components/sync/engine_impl/uss_migrator_unittest.cc
@@ -81,6 +81,10 @@ class UssMigratorTest : public ::testing::Test {
return entry_factory_->CreateSyncedItem(key, kModelType, false, specifics);
}
+ int64_t DeleteEntity(const std::string& key) {
+ return entry_factory_->CreateTombstone(key, kModelType);
+ }
+
base::Time GetCtimeForEntity(int64_t metahandle) {
ReadTransaction trans(FROM_HERE, user_share());
ReadNode read_node(&trans);
@@ -175,6 +179,18 @@ TEST_F(UssMigratorTest, MigrateMultipleBatches) {
EXPECT_EQ(kTag3, updates.at(2).entity.value().specifics.preference().name());
}
+TEST_F(UssMigratorTest, MigrateIgnoresTombstone) {
+ CreateTypeRoot();
+ SetProgressMarkerToken(kToken1);
+ DeleteEntity(kTag1);
+
+ ASSERT_TRUE(MigrateDirectoryData(kModelType, user_share(), worker()));
+
+ EXPECT_EQ(0, nudge_handler()->GetNumInitialDownloadNudges());
+ EXPECT_EQ(1U, processor()->GetNumUpdateResponses());
+ EXPECT_EQ(0U, processor()->GetNthUpdateResponse(0).size());
+}
+
TEST_F(UssMigratorTest, MigrateZero) {
CreateTypeRoot();
SetProgressMarkerToken(kToken1);
« no previous file with comments | « components/sync/engine_impl/uss_migrator.cc ('k') | components/sync/model/fake_model_type_sync_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698