| Index: components/sync/driver/ui_data_type_controller_unittest.cc
|
| diff --git a/components/sync_driver/ui_data_type_controller_unittest.cc b/components/sync/driver/ui_data_type_controller_unittest.cc
|
| similarity index 85%
|
| rename from components/sync_driver/ui_data_type_controller_unittest.cc
|
| rename to components/sync/driver/ui_data_type_controller_unittest.cc
|
| index 98df18a8422c715c914e79988936cf3df6c47990..e7e2bec6da65cfbed4bc656c96aa7cd3b315cd7f 100644
|
| --- a/components/sync_driver/ui_data_type_controller_unittest.cc
|
| +++ b/components/sync/driver/ui_data_type_controller_unittest.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "components/sync_driver/ui_data_type_controller.h"
|
| +#include "components/sync/driver/ui_data_type_controller.h"
|
|
|
| #include <memory>
|
| #include <utility>
|
| @@ -14,9 +14,9 @@
|
| #include "base/tracked_objects.h"
|
| #include "components/sync/api/fake_syncable_service.h"
|
| #include "components/sync/base/model_type.h"
|
| -#include "components/sync_driver/data_type_controller_mock.h"
|
| -#include "components/sync_driver/fake_generic_change_processor.h"
|
| -#include "components/sync_driver/fake_sync_client.h"
|
| +#include "components/sync/driver/data_type_controller_mock.h"
|
| +#include "components/sync/driver/fake_generic_change_processor.h"
|
| +#include "components/sync/driver/fake_sync_client.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
|
|
| using testing::_;
|
| @@ -35,19 +35,17 @@ class SyncUIDataTypeControllerTest : public testing::Test,
|
| public FakeSyncClient {
|
| public:
|
| SyncUIDataTypeControllerTest()
|
| - : type_(syncer::PREFERENCES),
|
| - change_processor_(NULL) {}
|
| + : type_(syncer::PREFERENCES), change_processor_(NULL) {}
|
|
|
| // FakeSyncClient overrides.
|
| base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType(
|
| - syncer::ModelType type) override {
|
| + syncer::ModelType type) override {
|
| return syncable_service_.AsWeakPtr();
|
| }
|
|
|
| void SetUp() override {
|
| - preference_dtc_ =
|
| - new UIDataTypeController(base::ThreadTaskRunnerHandle::Get(),
|
| - base::Closure(), type_, this);
|
| + preference_dtc_ = new UIDataTypeController(
|
| + base::ThreadTaskRunnerHandle::Get(), base::Closure(), type_, this);
|
| SetStartExpectations();
|
| }
|
|
|
| @@ -70,18 +68,14 @@ class SyncUIDataTypeControllerTest : public testing::Test,
|
| }
|
|
|
| void Start() {
|
| - preference_dtc_->LoadModels(
|
| - base::Bind(&ModelLoadCallbackMock::Run,
|
| - base::Unretained(&model_load_callback_)));
|
| - preference_dtc_->StartAssociating(
|
| - base::Bind(&StartCallbackMock::Run,
|
| - base::Unretained(&start_callback_)));
|
| + preference_dtc_->LoadModels(base::Bind(
|
| + &ModelLoadCallbackMock::Run, base::Unretained(&model_load_callback_)));
|
| + preference_dtc_->StartAssociating(base::Bind(
|
| + &StartCallbackMock::Run, base::Unretained(&start_callback_)));
|
| PumpLoop();
|
| }
|
|
|
| - void PumpLoop() {
|
| - message_loop_.RunUntilIdle();
|
| - }
|
| + void PumpLoop() { message_loop_.RunUntilIdle(); }
|
|
|
| base::MessageLoopForUI message_loop_;
|
| const syncer::ModelType type_;
|
| @@ -154,11 +148,8 @@ TEST_F(SyncUIDataTypeControllerTest, StartStopFirstRun) {
|
| TEST_F(SyncUIDataTypeControllerTest, StartAssociationFailed) {
|
| EXPECT_CALL(start_callback_,
|
| Run(DataTypeController::ASSOCIATION_FAILED, _, _));
|
| - syncable_service_.set_merge_data_and_start_syncing_error(
|
| - syncer::SyncError(FROM_HERE,
|
| - syncer::SyncError::DATATYPE_ERROR,
|
| - "Error",
|
| - type_));
|
| + syncable_service_.set_merge_data_and_start_syncing_error(syncer::SyncError(
|
| + FROM_HERE, syncer::SyncError::DATATYPE_ERROR, "Error", type_));
|
|
|
| EXPECT_EQ(DataTypeController::NOT_RUNNING, preference_dtc_->state());
|
| EXPECT_FALSE(syncable_service_.syncing());
|
| @@ -198,9 +189,7 @@ TEST_F(SyncUIDataTypeControllerTest, OnSingleDatatypeUnrecoverableError) {
|
|
|
| testing::Mock::VerifyAndClearExpectations(&start_callback_);
|
| EXPECT_CALL(model_load_callback_, Run(_, _));
|
| - syncer::SyncError error(FROM_HERE,
|
| - syncer::SyncError::DATATYPE_ERROR,
|
| - "error",
|
| + syncer::SyncError error(FROM_HERE, syncer::SyncError::DATATYPE_ERROR, "error",
|
| syncer::PREFERENCES);
|
| preference_dtc_->OnSingleDataTypeUnrecoverableError(error);
|
| }
|
|
|