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

Unified Diff: components/sync/driver/frontend_data_type_controller_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
Index: components/sync/driver/frontend_data_type_controller_unittest.cc
diff --git a/components/sync/driver/frontend_data_type_controller_unittest.cc b/components/sync/driver/frontend_data_type_controller_unittest.cc
index 20a75602c126088958f6dc4a8ec851b59256ae39..c8f86b520d1ff5078b12f242ef1693497104cbb3 100644
--- a/components/sync/driver/frontend_data_type_controller_unittest.cc
+++ b/components/sync/driver/frontend_data_type_controller_unittest.cc
@@ -24,13 +24,6 @@
#include "components/sync/driver/sync_api_component_factory_mock.h"
#include "testing/gtest/include/gtest/gtest.h"
-using browser_sync::FrontendDataTypeController;
-using browser_sync::FrontendDataTypeControllerMock;
-using sync_driver::ChangeProcessorMock;
-using sync_driver::DataTypeController;
-using sync_driver::ModelAssociatorMock;
-using sync_driver::ModelLoadCallbackMock;
-using sync_driver::StartCallbackMock;
using testing::_;
using testing::DoAll;
using testing::InvokeWithoutArgs;
@@ -38,22 +31,20 @@ using testing::Return;
using testing::SetArgumentPointee;
using testing::StrictMock;
-namespace {
+namespace syncer {
class FrontendDataTypeControllerFake : public FrontendDataTypeController {
public:
- FrontendDataTypeControllerFake(sync_driver::SyncClient* sync_client,
+ FrontendDataTypeControllerFake(SyncClient* sync_client,
FrontendDataTypeControllerMock* mock)
- : FrontendDataTypeController(syncer::BOOKMARKS,
- base::Closure(),
- sync_client),
+ : FrontendDataTypeController(BOOKMARKS, base::Closure(), sync_client),
mock_(mock),
sync_client_(sync_client) {}
~FrontendDataTypeControllerFake() override {}
private:
void CreateSyncComponents() override {
- sync_driver::SyncApiComponentFactory::SyncComponents sync_components =
+ SyncApiComponentFactory::SyncComponents sync_components =
sync_client_->GetSyncApiComponentFactory()
->CreateBookmarkSyncComponents(nullptr, CreateErrorHandler());
model_associator_.reset(sync_components.model_associator);
@@ -72,7 +63,7 @@ class FrontendDataTypeControllerFake : public FrontendDataTypeController {
}
FrontendDataTypeControllerMock* mock_;
- sync_driver::SyncClient* sync_client_;
+ SyncClient* sync_client_;
};
class SyncFrontendDataTypeControllerTest : public testing::Test {
@@ -101,7 +92,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_))
.WillOnce(DoAll(SetArgumentPointee<0>(true), Return(true)));
EXPECT_CALL(*model_associator_, AssociateModels(_, _))
- .WillOnce(Return(syncer::SyncError()));
+ .WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_.get(), RecordAssociationTime(_));
}
@@ -112,7 +103,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
void SetStopExpectations() {
EXPECT_CALL(*dtc_mock_.get(), CleanUpState());
EXPECT_CALL(*model_associator_, DisassociateModels())
- .WillOnce(Return(syncer::SyncError()));
+ .WillOnce(Return(SyncError()));
}
void SetStartFailExpectations(DataTypeController::ConfigureResult result) {
@@ -135,7 +126,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
ModelAssociatorMock* model_associator_;
ChangeProcessorMock* change_processor_;
SyncApiComponentFactoryMock components_factory_;
- sync_driver::FakeSyncClient sync_client_;
+ FakeSyncClient sync_client_;
std::unique_ptr<FrontendDataTypeControllerFake> frontend_dtc_;
std::unique_ptr<FrontendDataTypeControllerMock> dtc_mock_;
StartCallbackMock start_callback_;
@@ -158,7 +149,7 @@ TEST_F(SyncFrontendDataTypeControllerTest, StartFirstRun) {
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_))
.WillOnce(DoAll(SetArgumentPointee<0>(false), Return(true)));
EXPECT_CALL(*model_associator_, AssociateModels(_, _))
- .WillOnce(Return(syncer::SyncError()));
+ .WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_.get(), RecordAssociationTime(_));
SetActivateExpectations(DataTypeController::OK_FIRST_RUN);
EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state());
@@ -196,9 +187,8 @@ TEST_F(SyncFrontendDataTypeControllerTest, StartAssociationFailed) {
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_))
.WillOnce(DoAll(SetArgumentPointee<0>(true), Return(true)));
EXPECT_CALL(*model_associator_, AssociateModels(_, _))
- .WillOnce(
- Return(syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
- "error", syncer::BOOKMARKS)));
+ .WillOnce(Return(
+ SyncError(FROM_HERE, SyncError::DATATYPE_ERROR, "error", BOOKMARKS)));
EXPECT_CALL(*dtc_mock_.get(), RecordAssociationTime(_));
SetStartFailExpectations(DataTypeController::ASSOCIATION_FAILED);
@@ -245,4 +235,4 @@ TEST_F(SyncFrontendDataTypeControllerTest, Stop) {
EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state());
}
-} // namespace
+} // namespace syncer
« no previous file with comments | « components/sync/driver/frontend_data_type_controller_mock.cc ('k') | components/sync/driver/generic_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698