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

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

Issue 1310553005: [Sync] Replace ProfileSyncComponentsFactory with SyncClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really fix GN Created 5 years, 4 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/autofill_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
index 03359ace813e9926b6a439a054699bbbc45a6aa3..2762a8a1352618b9a2879c39b49ce4a6a31ee389 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -11,13 +11,13 @@
#include "base/run_loop.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/sync/glue/autofill_data_type_controller.h"
-#include "chrome/browser/sync/profile_sync_components_factory_mock.h"
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_service_mock.h"
#include "chrome/browser/web_data_service_factory.h"
#include "components/autofill/core/browser/webdata/autocomplete_syncable_service.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/sync_driver/data_type_controller_mock.h"
+#include "components/sync_driver/fake_sync_client.h"
#include "components/webdata_services/web_data_service_test_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -131,27 +131,26 @@ class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper {
DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapperSyncable);
};
-class SyncAutofillDataTypeControllerTest : public testing::Test {
+class SyncAutofillDataTypeControllerTest : public testing::Test,
+ public sync_driver::FakeSyncClient {
public:
SyncAutofillDataTypeControllerTest()
: thread_bundle_(content::TestBrowserThreadBundle::REAL_DB_THREAD),
service_(&profile_),
last_start_result_(sync_driver::DataTypeController::OK),
weak_ptr_factory_(this) {}
-
~SyncAutofillDataTypeControllerTest() override {}
- void SetUp() override {
- EXPECT_CALL(profile_sync_factory_,
- GetSyncableServiceForType(_)).
- WillRepeatedly(Return(base::WeakPtr<syncer::SyncableService>()));
+ // FakeSyncClient overrides.
+ scoped_refptr<autofill::AutofillWebDataService> GetWebDataService() override {
+ return WebDataServiceFactory::GetAutofillWebDataForProfile(
+ &profile_, ServiceAccessType::EXPLICIT_ACCESS);
+ }
+ void SetUp() override {
WebDataServiceFactory::GetInstance()->SetTestingFactory(
&profile_, MockWebDataServiceWrapperSyncable::Build);
-
- autofill_dtc_ =
- new AutofillDataTypeController(
- &profile_sync_factory_, &profile_);
+ autofill_dtc_ = new AutofillDataTypeController(this);
}
// Passed to AutofillDTC::Start().
@@ -178,7 +177,6 @@ class SyncAutofillDataTypeControllerTest : public testing::Test {
protected:
content::TestBrowserThreadBundle thread_bundle_;
- ProfileSyncComponentsFactoryMock profile_sync_factory_;
TestingProfile profile_;
ProfileSyncServiceMock service_;
scoped_refptr<AutofillDataTypeController> autofill_dtc_;

Powered by Google App Engine
This is Rietveld 408576698