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

Unified Diff: sync/engine/apply_control_data_updates_unittest.cc

Issue 1393633003: Sync: fix for the code that checks whether the initial download has completed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed control data types and added unit tests Created 5 years, 2 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: sync/engine/apply_control_data_updates_unittest.cc
diff --git a/sync/engine/apply_control_data_updates_unittest.cc b/sync/engine/apply_control_data_updates_unittest.cc
index 7ed6bd4899f0604a3044f142743cc43b7cf3ed7e..49b15c746a9370aa76b81001da5250ab9e5d2a24 100644
--- a/sync/engine/apply_control_data_updates_unittest.cc
+++ b/sync/engine/apply_control_data_updates_unittest.cc
@@ -914,4 +914,28 @@ TEST_F(ApplyControlDataUpdatesTest, ControlConflict) {
experiments().keystore_encryption().enabled());
}
+// Check that applying a control update marks the datatype as downloaded.
+TEST_F(ApplyControlDataUpdatesTest, ControlApplyMarksDownloadCompleted) {
+ {
+ syncable::WriteTransaction trans(FROM_HERE, UNITTEST, directory());
+ syncable::ModelNeutralMutableEntry entry(
+ &trans, syncable::CREATE_NEW_TYPE_ROOT, EXPERIMENTS);
+ ASSERT_TRUE(entry.good());
+ entry.PutServerIsDir(true);
+ entry.PutUniqueServerTag(ModelTypeToRootTag(EXPERIMENTS));
+ }
+
+ EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS));
Nicolas Zea 2015/10/09 22:23:34 This test doesn't cover the case where there are n
stanisc 2015/10/10 00:44:18 This case handles control types with implicit perm
+
+ std::string experiment_id = "experiment";
+ sync_pb::EntitySpecifics specifics;
+ specifics.mutable_experiments()->mutable_keystore_encryption()->set_enabled(
+ true);
+ entry_factory_->CreateUnappliedNewItem(experiment_id, specifics, false);
+
+ ApplyControlDataUpdates(directory());
+
+ EXPECT_TRUE(directory()->InitialSyncEndedForType(EXPERIMENTS));
+}
+
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698