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

Unified Diff: sync/sessions/model_type_registry_unittest.cc

Issue 280983002: Implement sync in the NonBlockingTypeProcessor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gyp error and some tests Created 6 years, 7 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 | « sync/sessions/model_type_registry.cc ('k') | sync/sync_core.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/sessions/model_type_registry_unittest.cc
diff --git a/sync/sessions/model_type_registry_unittest.cc b/sync/sessions/model_type_registry_unittest.cc
index 6b344ebf24c519bda894c4b284717f5d73f6ddcc..2d42215c79d237af0c775d6f1ec2be67be71bcdd 100644
--- a/sync/sessions/model_type_registry_unittest.cc
+++ b/sync/sessions/model_type_registry_unittest.cc
@@ -23,6 +23,14 @@ class ModelTypeRegistryTest : public ::testing::Test {
ModelTypeRegistry* registry();
+ static DataTypeState MakeInitialDataTypeState(ModelType type) {
+ DataTypeState state;
+ state.progress_marker.set_data_type_id(
+ GetSpecificsFieldNumberFromModelType(type));
+ state.next_client_id = 0;
+ return state;
+ }
+
private:
syncable::Directory* directory();
@@ -139,13 +147,17 @@ TEST_F(ModelTypeRegistryTest, NonBlockingTypes) {
EXPECT_TRUE(registry()->GetEnabledTypes().Empty());
- registry()->InitializeNonBlockingType(
- syncer::THEMES, task_runner, themes_processor.AsWeakPtrForUI());
+ registry()->InitializeNonBlockingType(syncer::THEMES,
+ MakeInitialDataTypeState(THEMES),
+ task_runner,
+ themes_processor.AsWeakPtrForUI());
EXPECT_TRUE(registry()->GetEnabledTypes().Equals(
ModelTypeSet(syncer::THEMES)));
- registry()->InitializeNonBlockingType(
- syncer::SESSIONS, task_runner, sessions_processor.AsWeakPtrForUI());
+ registry()->InitializeNonBlockingType(syncer::SESSIONS,
+ MakeInitialDataTypeState(SESSIONS),
+ task_runner,
+ sessions_processor.AsWeakPtrForUI());
EXPECT_TRUE(registry()->GetEnabledTypes().Equals(
ModelTypeSet(syncer::THEMES, syncer::SESSIONS)));
@@ -172,8 +184,10 @@ TEST_F(ModelTypeRegistryTest, NonBlockingTypesWithDirectoryTypes) {
EXPECT_TRUE(registry()->GetEnabledTypes().Empty());
// Add the themes non-blocking type.
- registry()->InitializeNonBlockingType(
- syncer::THEMES, task_runner, themes_processor.AsWeakPtrForUI());
+ registry()->InitializeNonBlockingType(syncer::THEMES,
+ MakeInitialDataTypeState(THEMES),
+ task_runner,
+ themes_processor.AsWeakPtrForUI());
current_types.Put(syncer::THEMES);
EXPECT_TRUE(registry()->GetEnabledTypes().Equals(current_types));
@@ -183,8 +197,10 @@ TEST_F(ModelTypeRegistryTest, NonBlockingTypesWithDirectoryTypes) {
EXPECT_TRUE(registry()->GetEnabledTypes().Equals(current_types));
// Add sessions non-blocking type.
- registry()->InitializeNonBlockingType(
- syncer::SESSIONS, task_runner, sessions_processor.AsWeakPtrForUI());
+ registry()->InitializeNonBlockingType(syncer::SESSIONS,
+ MakeInitialDataTypeState(SESSIONS),
+ task_runner,
+ sessions_processor.AsWeakPtrForUI());
current_types.Put(syncer::SESSIONS);
EXPECT_TRUE(registry()->GetEnabledTypes().Equals(current_types));
@@ -210,10 +226,14 @@ TEST_F(ModelTypeRegistryTest, DeletionOrdering) {
EXPECT_TRUE(registry()->GetEnabledTypes().Empty());
- registry()->InitializeNonBlockingType(
- syncer::THEMES, task_runner, themes_processor->AsWeakPtrForUI());
- registry()->InitializeNonBlockingType(
- syncer::SESSIONS, task_runner, sessions_processor->AsWeakPtrForUI());
+ registry()->InitializeNonBlockingType(syncer::THEMES,
+ MakeInitialDataTypeState(THEMES),
+ task_runner,
+ themes_processor->AsWeakPtrForUI());
+ registry()->InitializeNonBlockingType(syncer::SESSIONS,
+ MakeInitialDataTypeState(SESSIONS),
+ task_runner,
+ sessions_processor->AsWeakPtrForUI());
EXPECT_TRUE(registry()->GetEnabledTypes().Equals(
ModelTypeSet(syncer::THEMES, syncer::SESSIONS)));
« no previous file with comments | « sync/sessions/model_type_registry.cc ('k') | sync/sync_core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698