| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ |
| 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ | 6 #define COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
| 14 #include "base/test/sequenced_worker_pool_owner.h" | 14 #include "base/test/sequenced_worker_pool_owner.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/browser_sync/profile_sync_service.h" | 16 #include "components/browser_sync/profile_sync_service.h" |
| 17 #include "components/invalidation/impl/fake_invalidation_service.h" | 17 #include "components/invalidation/impl/fake_invalidation_service.h" |
| 18 #include "components/signin/core/browser/account_tracker_service.h" | 18 #include "components/signin/core/browser/account_tracker_service.h" |
| 19 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" | 19 #include "components/signin/core/browser/fake_profile_oauth2_token_service.h" |
| 20 #include "components/signin/core/browser/fake_signin_manager.h" | 20 #include "components/signin/core/browser/fake_signin_manager.h" |
| 21 #include "components/signin/core/browser/test_signin_client.h" | 21 #include "components/signin/core/browser/test_signin_client.h" |
| 22 #include "components/sync/driver/fake_sync_client.h" | 22 #include "components/sync/driver/fake_sync_client.h" |
| 23 #include "components/sync/driver/sync_api_component_factory_mock.h" | 23 #include "components/sync/driver/sync_api_component_factory_mock.h" |
| 24 #include "components/sync_preferences/testing_pref_service_syncable.h" |
| 24 #include "components/sync_sessions/fake_sync_sessions_client.h" | 25 #include "components/sync_sessions/fake_sync_sessions_client.h" |
| 25 #include "components/syncable_prefs/testing_pref_service_syncable.h" | |
| 26 | 26 |
| 27 namespace base { | 27 namespace base { |
| 28 class Time; | 28 class Time; |
| 29 class TimeDelta; | 29 class TimeDelta; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace history { | 32 namespace history { |
| 33 class HistoryService; | 33 class HistoryService; |
| 34 } | 34 } |
| 35 | 35 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 ProfileSyncService::InitParams CreateBasicInitParams( | 130 ProfileSyncService::InitParams CreateBasicInitParams( |
| 131 ProfileSyncService::StartBehavior start_behavior, | 131 ProfileSyncService::StartBehavior start_behavior, |
| 132 std::unique_ptr<syncer::SyncClient> sync_client); | 132 std::unique_ptr<syncer::SyncClient> sync_client); |
| 133 | 133 |
| 134 // Accessors | 134 // Accessors |
| 135 | 135 |
| 136 net::URLRequestContextGetter* url_request_context() { | 136 net::URLRequestContextGetter* url_request_context() { |
| 137 return url_request_context_.get(); | 137 return url_request_context_.get(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 syncable_prefs::TestingPrefServiceSyncable* pref_service() { | 140 sync_preferences::TestingPrefServiceSyncable* pref_service() { |
| 141 return &pref_service_; | 141 return &pref_service_; |
| 142 } | 142 } |
| 143 | 143 |
| 144 FakeProfileOAuth2TokenService* auth_service() { return &auth_service_; } | 144 FakeProfileOAuth2TokenService* auth_service() { return &auth_service_; } |
| 145 | 145 |
| 146 FakeSigninManagerType* signin_manager() { return &signin_manager_; } | 146 FakeSigninManagerType* signin_manager() { return &signin_manager_; } |
| 147 | 147 |
| 148 AccountTrackerService* account_tracker() { return &account_tracker_; } | 148 AccountTrackerService* account_tracker() { return &account_tracker_; } |
| 149 | 149 |
| 150 syncer::SyncApiComponentFactoryMock* component_factory() { | 150 syncer::SyncApiComponentFactoryMock* component_factory() { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 162 base::SingleThreadTaskRunner* db_thread() { return db_thread_.get(); } | 162 base::SingleThreadTaskRunner* db_thread() { return db_thread_.get(); } |
| 163 | 163 |
| 164 void set_db_thread( | 164 void set_db_thread( |
| 165 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread) { | 165 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread) { |
| 166 db_thread_ = db_thread; | 166 db_thread_ = db_thread; |
| 167 } | 167 } |
| 168 | 168 |
| 169 private: | 169 private: |
| 170 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; | 170 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; |
| 171 base::SequencedWorkerPoolOwner worker_pool_owner_; | 171 base::SequencedWorkerPoolOwner worker_pool_owner_; |
| 172 syncable_prefs::TestingPrefServiceSyncable pref_service_; | 172 sync_preferences::TestingPrefServiceSyncable pref_service_; |
| 173 TestSigninClient signin_client_; | 173 TestSigninClient signin_client_; |
| 174 AccountTrackerService account_tracker_; | 174 AccountTrackerService account_tracker_; |
| 175 FakeSigninManagerType signin_manager_; | 175 FakeSigninManagerType signin_manager_; |
| 176 FakeProfileOAuth2TokenService auth_service_; | 176 FakeProfileOAuth2TokenService auth_service_; |
| 177 syncer::SyncApiComponentFactoryMock component_factory_; | 177 syncer::SyncApiComponentFactoryMock component_factory_; |
| 178 sync_sessions::FakeSyncSessionsClient sync_sessions_client_; | 178 sync_sessions::FakeSyncSessionsClient sync_sessions_client_; |
| 179 invalidation::FakeInvalidationService fake_invalidation_service_; | 179 invalidation::FakeInvalidationService fake_invalidation_service_; |
| 180 scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 180 scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
| 181 | 181 |
| 182 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceBundle); | 182 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceBundle); |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 } // namespace browser_sync | 185 } // namespace browser_sync |
| 186 | 186 |
| 187 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ | 187 #endif // COMPONENTS_BROWSER_SYNC_PROFILE_SYNC_TEST_UTIL_H_ |
| OLD | NEW |