| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/profile_sync_test_util.h" | 5 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 13 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 14 #include "chrome/browser/sync/chrome_sync_client.h" | 14 #include "chrome/browser/sync/chrome_sync_client.h" |
| 15 #include "chrome/common/channel_info.h" | 15 #include "chrome/common/channel_info.h" |
| 16 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
| 17 #include "components/browser_sync/browser/profile_sync_service.h" | 17 #include "components/browser_sync/browser/profile_sync_service.h" |
| 18 #include "components/browser_sync/browser/profile_sync_test_util.h" | 18 #include "components/browser_sync/browser/profile_sync_test_util.h" |
| 19 #include "components/signin/core/browser/signin_manager.h" | 19 #include "components/signin/core/browser/signin_manager.h" |
| 20 #include "components/sync_driver/signin_manager_wrapper.h" | 20 #include "components/sync/driver/signin_manager_wrapper.h" |
| 21 #include "components/sync_driver/startup_controller.h" | 21 #include "components/sync/driver/startup_controller.h" |
| 22 #include "components/sync_driver/sync_api_component_factory_mock.h" | 22 #include "components/sync/driver/sync_api_component_factory_mock.h" |
| 23 | 23 |
| 24 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( | 24 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( |
| 25 Profile* profile) { | 25 Profile* profile) { |
| 26 auto sync_client = | 26 auto sync_client = |
| 27 base::WrapUnique(new browser_sync::ChromeSyncClient(profile)); | 27 base::WrapUnique(new browser_sync::ChromeSyncClient(profile)); |
| 28 | 28 |
| 29 sync_client->SetSyncApiComponentFactoryForTesting( | 29 sync_client->SetSyncApiComponentFactoryForTesting( |
| 30 base::WrapUnique(new SyncApiComponentFactoryMock())); | 30 base::WrapUnique(new SyncApiComponentFactoryMock())); |
| 31 | 31 |
| 32 ProfileSyncService::InitParams init_params = | 32 ProfileSyncService::InitParams init_params = |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ->SetAuthenticatedAccountInfo("12345", "foo"); | 67 ->SetAuthenticatedAccountInfo("12345", "foo"); |
| 68 return profile; | 68 return profile; |
| 69 } | 69 } |
| 70 | 70 |
| 71 std::unique_ptr<KeyedService> BuildMockProfileSyncService( | 71 std::unique_ptr<KeyedService> BuildMockProfileSyncService( |
| 72 content::BrowserContext* context) { | 72 content::BrowserContext* context) { |
| 73 return base::WrapUnique( | 73 return base::WrapUnique( |
| 74 new ProfileSyncServiceMock(CreateProfileSyncServiceParamsForTest( | 74 new ProfileSyncServiceMock(CreateProfileSyncServiceParamsForTest( |
| 75 Profile::FromBrowserContext(context)))); | 75 Profile::FromBrowserContext(context)))); |
| 76 } | 76 } |
| OLD | NEW |