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

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

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit tests Created 8 years, 4 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 58b34c826e023ba38094a55441025acd4b242805..3c8d587cb670647f071bb5ad9c1c79de396be21d 100644
--- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc
+++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc
@@ -204,7 +204,7 @@ class SyncBackendHostTest : public testing::Test {
// Synchronously configures the backend's datatypes.
void ConfigureDataTypes(syncer::ModelTypeSet types_to_add,
syncer::ModelTypeSet types_to_remove) {
- types_to_add.Put(syncer::NIGORI);
+ types_to_add.PutAll(syncer::EarlyDownloadTypes());
backend_->ConfigureDataTypes(
syncer::CONFIGURE_REASON_RECONFIGURATION,
types_to_add,
@@ -247,28 +247,28 @@ class SyncBackendHostTest : public testing::Test {
TEST_F(SyncBackendHostTest, InitShutdown) {
InitializeBackend();
EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().Equals(
- syncer::ModelTypeSet(syncer::NIGORI)));
+ syncer::EarlyDownloadTypes()));
EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(
- syncer::ModelTypeSet(syncer::NIGORI)));
+ syncer::EarlyDownloadTypes()));
EXPECT_TRUE(fake_manager_->GetTypesWithEmptyProgressMarkerToken(
- syncer::ModelTypeSet(syncer::NIGORI)).Empty());
+ syncer::EarlyDownloadTypes()).Empty());
}
// Test first time sync scenario. All types should be properly configured.
TEST_F(SyncBackendHostTest, FirstTimeSync) {
InitializeBackend();
EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().Equals(
- syncer::ModelTypeSet(syncer::NIGORI)));
+ syncer::EarlyDownloadTypes()));
EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(
- syncer::ModelTypeSet(syncer::NIGORI)));
+ syncer::EarlyDownloadTypes()));
EXPECT_TRUE(fake_manager_->GetTypesWithEmptyProgressMarkerToken(
- syncer::ModelTypeSet(syncer::NIGORI)).Empty());
+ syncer::EarlyDownloadTypes()).Empty());
ConfigureDataTypes(enabled_types_,
Difference(syncer::ModelTypeSet::All(),
enabled_types_));
EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().HasAll(
- enabled_types_));
+ Difference(enabled_types_, syncer::EarlyDownloadTypes())));
EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(enabled_types_));
EXPECT_TRUE(fake_manager_->GetAndResetEnabledTypes().Equals(enabled_types_));
EXPECT_TRUE(fake_manager_->GetTypesWithEmptyProgressMarkerToken(
@@ -348,12 +348,12 @@ TEST_F(SyncBackendHostTest, LostDB) {
// left untouched.
InitializeBackend();
EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().Equals(
- syncer::ModelTypeSet(syncer::NIGORI)));
+ syncer::ModelTypeSet(syncer::EarlyDownloadTypes())));
EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(
- syncer::ModelTypeSet(syncer::NIGORI)));
+ syncer::ModelTypeSet(syncer::EarlyDownloadTypes())));
EXPECT_TRUE(fake_manager_->GetTypesWithEmptyProgressMarkerToken(
enabled_types_).Equals(
- Difference(enabled_types_, syncer::ModelTypeSet(syncer::NIGORI))));
+ Difference(enabled_types_, syncer::EarlyDownloadTypes())));
// The database was empty, so any cleaning is entirely optional. We want to
// reset this value before running the next part of the test, though.
@@ -364,7 +364,7 @@ TEST_F(SyncBackendHostTest, LostDB) {
Difference(syncer::ModelTypeSet::All(),
enabled_types_));
EXPECT_TRUE(fake_manager_->GetAndResetDownloadedTypes().HasAll(
- enabled_types_));
+ Difference(enabled_types_, syncer::EarlyDownloadTypes())));
EXPECT_TRUE(Intersection(fake_manager_->GetAndResetCleanedTypes(),
enabled_types_).Empty());
EXPECT_TRUE(fake_manager_->InitialSyncEndedTypes().Equals(enabled_types_));

Powered by Google App Engine
This is Rietveld 408576698