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 |