diff options
Diffstat (limited to 'chromium/components/browser_sync/profile_sync_test_util.h')
-rw-r--r-- | chromium/components/browser_sync/profile_sync_test_util.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/chromium/components/browser_sync/profile_sync_test_util.h b/chromium/components/browser_sync/profile_sync_test_util.h index a576c343267..9bacf1f34d9 100644 --- a/chromium/components/browser_sync/profile_sync_test_util.h +++ b/chromium/components/browser_sync/profile_sync_test_util.h @@ -8,20 +8,22 @@ #include <memory> #include "base/callback.h" -#include "base/files/scoped_temp_dir.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "components/browser_sync/profile_sync_service.h" #include "components/invalidation/impl/fake_invalidation_service.h" #include "components/signin/core/browser/account_tracker_service.h" +#include "components/signin/core/browser/fake_gaia_cookie_manager_service.h" #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" #include "components/signin/core/browser/fake_signin_manager.h" #include "components/signin/core/browser/test_signin_client.h" #include "components/sync/driver/fake_sync_client.h" #include "components/sync/driver/sync_api_component_factory_mock.h" +#include "components/sync/model/test_model_type_store_service.h" #include "components/sync_preferences/testing_pref_service_syncable.h" #include "components/sync_sessions/mock_sync_sessions_client.h" #include "services/identity/public/cpp/identity_manager.h" +#include "services/network/test/test_url_loader_factory.h" namespace history { class HistoryService; @@ -35,6 +37,10 @@ namespace user_prefs { class PrefRegistrySyncable; } +namespace sync_sessions { +class LocalSessionEventRouter; +} + namespace browser_sync { // Call this to register preferences needed for ProfileSyncService creation. @@ -74,7 +80,7 @@ class ProfileSyncServiceBundle { // The client will call this callback to produce the SyncableService // specific to |type|. void SetSyncableServiceCallback( - const base::Callback<base::WeakPtr<syncer::SyncableService>( + const base::RepeatingCallback<base::WeakPtr<syncer::SyncableService>( syncer::ModelType type)>& get_syncable_service_callback); // The client will call this callback to produce the SyncService for the @@ -125,6 +131,10 @@ class ProfileSyncServiceBundle { return url_request_context_.get(); } + network::TestURLLoaderFactory* url_loader_factory() { + return &test_url_loader_factory_; + } + sync_preferences::TestingPrefServiceSyncable* pref_service() { return &pref_service_; } @@ -149,27 +159,33 @@ class ProfileSyncServiceBundle { return &fake_invalidation_service_; } - base::SingleThreadTaskRunner* db_thread() { return db_thread_.get(); } + base::SequencedTaskRunner* db_thread() { return db_thread_.get(); } void set_db_thread( - const scoped_refptr<base::SingleThreadTaskRunner>& db_thread) { + const scoped_refptr<base::SequencedTaskRunner>& db_thread) { db_thread_ = db_thread; } private: - scoped_refptr<base::SingleThreadTaskRunner> db_thread_; + scoped_refptr<base::SequencedTaskRunner> db_thread_; sync_preferences::TestingPrefServiceSyncable pref_service_; + syncer::TestModelTypeStoreService model_type_store_service_; TestSigninClient signin_client_; AccountTrackerService account_tracker_; FakeSigninManagerType signin_manager_; FakeProfileOAuth2TokenService auth_service_; + FakeGaiaCookieManagerService gaia_cookie_manager_service_; identity::IdentityManager identity_manager_; - syncer::SyncApiComponentFactoryMock component_factory_; + testing::NiceMock<syncer::SyncApiComponentFactoryMock> component_factory_; + std::unique_ptr<sync_sessions::LocalSessionEventRouter> + local_session_event_router_; testing::NiceMock<sync_sessions::MockSyncSessionsClient> sync_sessions_client_; invalidation::FakeInvalidationService fake_invalidation_service_; + // TODO(https://crbug.com/844968): Remove references to url_request_context_ + // once the rest of the sync engine is migrated to network service. scoped_refptr<net::URLRequestContextGetter> url_request_context_; - base::ScopedTempDir base_directory_; + network::TestURLLoaderFactory test_url_loader_factory_; DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceBundle); }; |