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

Unified Diff: components/sync/engine_impl/model_type_registry_unittest.cc

Issue 2376123003: [Sync] Move //components/sync to the syncer namespace. (Closed)
Patch Set: Rebase. Created 4 years, 3 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/model_type_registry.cc ('k') | components/sync/engine_impl/model_type_worker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/model_type_registry_unittest.cc
diff --git a/components/sync/engine_impl/model_type_registry_unittest.cc b/components/sync/engine_impl/model_type_registry_unittest.cc
index 405d60b1578b2c2238dac7c883374e72982c94e6..fd0bd02e7be667732cf1267c252339c9e46c7a5d 100644
--- a/components/sync/engine_impl/model_type_registry_unittest.cc
+++ b/components/sync/engine_impl/model_type_registry_unittest.cc
@@ -39,11 +39,11 @@ class ModelTypeRegistryTest : public ::testing::Test {
return state;
}
- static std::unique_ptr<syncer_v2::ActivationContext> MakeActivationContext(
+ static std::unique_ptr<ActivationContext> MakeActivationContext(
const sync_pb::DataTypeState& data_type_state,
- std::unique_ptr<syncer_v2::ModelTypeProcessor> type_processor) {
- std::unique_ptr<syncer_v2::ActivationContext> context =
- base::WrapUnique(new syncer_v2::ActivationContext);
+ std::unique_ptr<ModelTypeProcessor> type_processor) {
+ std::unique_ptr<ActivationContext> context =
+ base::WrapUnique(new ActivationContext);
context->data_type_state = data_type_state;
context->type_processor = std::move(type_processor);
return context;
@@ -182,22 +182,19 @@ TEST_F(ModelTypeRegistryTest, NonBlockingTypes) {
EXPECT_TRUE(registry()->GetEnabledTypes().Empty());
registry()->ConnectType(
- syncer::THEMES,
- MakeActivationContext(
- MakeInitialDataTypeState(THEMES),
- base::MakeUnique<syncer_v2::FakeModelTypeProcessor>()));
- EXPECT_EQ(ModelTypeSet(syncer::THEMES), registry()->GetEnabledTypes());
+ THEMES,
+ MakeActivationContext(MakeInitialDataTypeState(THEMES),
+ base::MakeUnique<FakeModelTypeProcessor>()));
+ EXPECT_EQ(ModelTypeSet(THEMES), registry()->GetEnabledTypes());
registry()->ConnectType(
- syncer::SESSIONS,
- MakeActivationContext(
- MakeInitialDataTypeState(SESSIONS),
- base::MakeUnique<syncer_v2::FakeModelTypeProcessor>()));
- EXPECT_EQ(ModelTypeSet(syncer::THEMES, syncer::SESSIONS),
- registry()->GetEnabledTypes());
+ SESSIONS,
+ MakeActivationContext(MakeInitialDataTypeState(SESSIONS),
+ base::MakeUnique<FakeModelTypeProcessor>()));
+ EXPECT_EQ(ModelTypeSet(THEMES, SESSIONS), registry()->GetEnabledTypes());
- registry()->DisconnectType(syncer::THEMES);
- EXPECT_EQ(ModelTypeSet(syncer::SESSIONS), registry()->GetEnabledTypes());
+ registry()->DisconnectType(THEMES);
+ EXPECT_EQ(ModelTypeSet(SESSIONS), registry()->GetEnabledTypes());
// Allow ModelTypeRegistry destruction to delete the
// Sessions' ModelTypeSyncWorker.
@@ -218,11 +215,10 @@ TEST_F(ModelTypeRegistryTest, NonBlockingTypesWithDirectoryTypes) {
// Add the themes non-blocking type.
registry()->ConnectType(
- syncer::THEMES,
- MakeActivationContext(
- MakeInitialDataTypeState(THEMES),
- base::MakeUnique<syncer_v2::FakeModelTypeProcessor>()));
- current_types.Put(syncer::THEMES);
+ THEMES,
+ MakeActivationContext(MakeInitialDataTypeState(THEMES),
+ base::MakeUnique<FakeModelTypeProcessor>()));
+ current_types.Put(THEMES);
EXPECT_EQ(current_types, registry()->GetEnabledTypes());
// Add some directory types.
@@ -232,16 +228,15 @@ TEST_F(ModelTypeRegistryTest, NonBlockingTypesWithDirectoryTypes) {
// Add sessions non-blocking type.
registry()->ConnectType(
- syncer::SESSIONS,
- MakeActivationContext(
- MakeInitialDataTypeState(SESSIONS),
- base::MakeUnique<syncer_v2::FakeModelTypeProcessor>()));
- current_types.Put(syncer::SESSIONS);
+ SESSIONS,
+ MakeActivationContext(MakeInitialDataTypeState(SESSIONS),
+ base::MakeUnique<FakeModelTypeProcessor>()));
+ current_types.Put(SESSIONS);
EXPECT_EQ(current_types, registry()->GetEnabledTypes());
// Remove themes non-blocking type.
- registry()->DisconnectType(syncer::THEMES);
- current_types.Remove(syncer::THEMES);
+ registry()->DisconnectType(THEMES);
+ current_types.Remove(THEMES);
EXPECT_EQ(current_types, registry()->GetEnabledTypes());
// Clear all directory types.
@@ -267,10 +262,9 @@ TEST_F(ModelTypeRegistryTest, GetInitialSyncEndedTypes) {
sync_pb::DataTypeState data_type_state = MakeInitialDataTypeState(THEMES);
data_type_state.set_initial_sync_done(true);
registry()->ConnectType(
- syncer::THEMES,
- MakeActivationContext(
- data_type_state,
- base::WrapUnique(new syncer_v2::FakeModelTypeProcessor())));
+ THEMES,
+ MakeActivationContext(data_type_state,
+ base::WrapUnique(new FakeModelTypeProcessor())));
EXPECT_EQ(ModelTypeSet(AUTOFILL, THEMES),
registry()->GetInitialSyncEndedTypes());
« no previous file with comments | « components/sync/engine_impl/model_type_registry.cc ('k') | components/sync/engine_impl/model_type_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698