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

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

Issue 408003002: [Sync] Fix namespace for sync_driver component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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/search_engine_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc
index 52f0b9146195fc89a9cbbc8f9f1656dc2e630f5c..e8952c5dacd1ace41c9412d09ff59d59f1e933d3 100644
--- a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc
@@ -40,7 +40,7 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test {
// This allows us to control the associated TemplateURLService.
search_engine_dtc_ = new SearchEngineDataTypeController(
profile_sync_factory_.get(), &profile_,
- DataTypeController::DisableTypeCallback());
+ sync_driver::DataTypeController::DisableTypeCallback());
}
virtual void TearDown() {
@@ -58,9 +58,10 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test {
void SetStartExpectations() {
search_engine_dtc_->SetGenericChangeProcessorFactoryForTest(
- make_scoped_ptr<GenericChangeProcessorFactory>(
- new FakeGenericChangeProcessorFactory(make_scoped_ptr(
- new FakeGenericChangeProcessor(profile_sync_factory_.get())))));
+ make_scoped_ptr<sync_driver::GenericChangeProcessorFactory>(
+ new sync_driver::FakeGenericChangeProcessorFactory(
+ make_scoped_ptr(new sync_driver::FakeGenericChangeProcessor(
+ profile_sync_factory_.get())))));
EXPECT_CALL(model_load_callback_, Run(_, _));
EXPECT_CALL(*profile_sync_factory_,
GetSyncableServiceForType(syncer::SEARCH_ENGINES)).
@@ -69,10 +70,10 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test {
void Start() {
search_engine_dtc_->LoadModels(
- base::Bind(&ModelLoadCallbackMock::Run,
+ base::Bind(&sync_driver::ModelLoadCallbackMock::Run,
base::Unretained(&model_load_callback_)));
search_engine_dtc_->StartAssociating(
- base::Bind(&StartCallbackMock::Run,
+ base::Bind(&sync_driver::StartCallbackMock::Run,
base::Unretained(&start_callback_)));
}
@@ -83,20 +84,22 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test {
scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_;
scoped_ptr<ProfileSyncServiceMock> service_;
syncer::FakeSyncableService syncable_service_;
- StartCallbackMock start_callback_;
- ModelLoadCallbackMock model_load_callback_;
+ sync_driver::StartCallbackMock start_callback_;
+ sync_driver::ModelLoadCallbackMock model_load_callback_;
};
TEST_F(SyncSearchEngineDataTypeControllerTest, StartURLServiceReady) {
SetStartExpectations();
// We want to start ready.
PreloadTemplateURLService();
- EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _));
+ EXPECT_CALL(start_callback_, Run(sync_driver::DataTypeController::OK, _, _));
- EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
Start();
- EXPECT_EQ(DataTypeController::RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::RUNNING,
+ search_engine_dtc_->state());
EXPECT_TRUE(syncable_service_.syncing());
}
@@ -104,16 +107,18 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StartURLServiceNotReady) {
EXPECT_CALL(model_load_callback_, Run(_, _));
EXPECT_FALSE(syncable_service_.syncing());
search_engine_dtc_->LoadModels(
- base::Bind(&ModelLoadCallbackMock::Run,
+ base::Bind(&sync_driver::ModelLoadCallbackMock::Run,
base::Unretained(&model_load_callback_)));
EXPECT_TRUE(search_engine_dtc_->GetSubscriptionForTesting());
- EXPECT_EQ(DataTypeController::MODEL_STARTING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::MODEL_STARTING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
// Send the notification that the TemplateURLService has started.
PreloadTemplateURLService();
EXPECT_EQ(NULL, search_engine_dtc_->GetSubscriptionForTesting());
- EXPECT_EQ(DataTypeController::MODEL_LOADED, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::MODEL_LOADED,
+ search_engine_dtc_->state());
// Wait until WebDB is loaded before we shut it down.
base::RunLoop().RunUntilIdle();
@@ -123,7 +128,7 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StartAssociationFailed) {
SetStartExpectations();
PreloadTemplateURLService();
EXPECT_CALL(start_callback_,
- Run(DataTypeController::ASSOCIATION_FAILED, _, _));
+ Run(sync_driver::DataTypeController::ASSOCIATION_FAILED, _, _));
syncable_service_.set_merge_data_and_start_syncing_error(
syncer::SyncError(FROM_HERE,
syncer::SyncError::DATATYPE_ERROR,
@@ -131,25 +136,30 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StartAssociationFailed) {
syncer::SEARCH_ENGINES));
Start();
- EXPECT_EQ(DataTypeController::DISABLED, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::DISABLED,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
search_engine_dtc_->Stop();
- EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
}
TEST_F(SyncSearchEngineDataTypeControllerTest, Stop) {
SetStartExpectations();
PreloadTemplateURLService();
- EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _));
+ EXPECT_CALL(start_callback_, Run(sync_driver::DataTypeController::OK, _, _));
- EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
Start();
- EXPECT_EQ(DataTypeController::RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::RUNNING,
+ search_engine_dtc_->state());
EXPECT_TRUE(syncable_service_.syncing());
search_engine_dtc_->Stop();
- EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
}
@@ -157,14 +167,16 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StopBeforeLoaded) {
EXPECT_CALL(model_load_callback_, Run(_, _));
EXPECT_FALSE(syncable_service_.syncing());
search_engine_dtc_->LoadModels(
- base::Bind(&ModelLoadCallbackMock::Run,
+ base::Bind(&sync_driver::ModelLoadCallbackMock::Run,
base::Unretained(&model_load_callback_)));
EXPECT_TRUE(search_engine_dtc_->GetSubscriptionForTesting());
- EXPECT_EQ(DataTypeController::MODEL_STARTING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::MODEL_STARTING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
search_engine_dtc_->Stop();
EXPECT_EQ(NULL, search_engine_dtc_->GetSubscriptionForTesting());
- EXPECT_EQ(DataTypeController::NOT_RUNNING, search_engine_dtc_->state());
+ EXPECT_EQ(sync_driver::DataTypeController::NOT_RUNNING,
+ search_engine_dtc_->state());
EXPECT_FALSE(syncable_service_.syncing());
}
« no previous file with comments | « chrome/browser/sync/glue/search_engine_data_type_controller.cc ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698