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

Unified Diff: components/sync_bookmarks/bookmark_data_type_controller_unittest.cc

Issue 2289143003: [Sync] Convert DTCs to be not RefCounted and NonThreadSafe. (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_bookmarks/bookmark_data_type_controller_unittest.cc
diff --git a/components/sync_bookmarks/bookmark_data_type_controller_unittest.cc b/components/sync_bookmarks/bookmark_data_type_controller_unittest.cc
index 32efcbe0998a2ad06256a54d5fec07b48b7f2f84..50522a35c158100a62d9bc1694d5d2749050f47f 100644
--- a/components/sync_bookmarks/bookmark_data_type_controller_unittest.cc
+++ b/components/sync_bookmarks/bookmark_data_type_controller_unittest.cc
@@ -77,9 +77,8 @@ class SyncBookmarkDataTypeControllerTest : public testing::Test,
profile_sync_factory_.reset(
new SyncApiComponentFactoryMock(model_associator_,
change_processor_));
- bookmark_dtc_ =
- new BookmarkDataTypeController(base::ThreadTaskRunnerHandle::Get(),
- base::Bind(&base::DoNothing), this);
+ bookmark_dtc_.reset(
+ new BookmarkDataTypeController(base::Bind(&base::DoNothing), this));
}
protected:
@@ -109,7 +108,6 @@ class SyncBookmarkDataTypeControllerTest : public testing::Test,
void SetAssociateExpectations() {
EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()).
WillRepeatedly(Return(true));
- EXPECT_CALL(*profile_sync_factory_, CreateBookmarkSyncComponents(_, _));
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
WillRepeatedly(DoAll(SetArgumentPointee<0>(true), Return(true)));
EXPECT_CALL(*model_associator_, AssociateModels(_, _)).
@@ -136,10 +134,10 @@ class SyncBookmarkDataTypeControllerTest : public testing::Test,
}
base::MessageLoop message_loop_;
- scoped_refptr<BookmarkDataTypeController> bookmark_dtc_;
std::unique_ptr<SyncApiComponentFactoryMock> profile_sync_factory_;
std::unique_ptr<BookmarkModel> bookmark_model_;
std::unique_ptr<HistoryMock> history_service_;
+ std::unique_ptr<BookmarkDataTypeController> bookmark_dtc_;
sync_driver::FakeSyncService service_;
ModelAssociatorMock* model_associator_;
ChangeProcessorMock* change_processor_;
@@ -244,7 +242,6 @@ TEST_F(SyncBookmarkDataTypeControllerTest, StartAssociationFailed) {
CreateBookmarkModel(LOAD_MODEL);
SetStartExpectations();
// Set up association to fail.
- EXPECT_CALL(*profile_sync_factory_, CreateBookmarkSyncComponents(_, _));
EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()).
WillRepeatedly(Return(true));
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
@@ -266,7 +263,6 @@ TEST_F(SyncBookmarkDataTypeControllerTest,
CreateBookmarkModel(LOAD_MODEL);
SetStartExpectations();
// Set up association to fail with an unrecoverable error.
- EXPECT_CALL(*profile_sync_factory_, CreateBookmarkSyncComponents(_, _));
EXPECT_CALL(*model_associator_, CryptoReadyIfNecessary()).
WillRepeatedly(Return(true));
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
« no previous file with comments | « components/sync_bookmarks/bookmark_data_type_controller.cc ('k') | components/sync_bookmarks/bookmark_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698