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/profile_sync_service.h" | 17 #include "components/browser_sync/profile_sync_service.h" |
18 #include "components/browser_sync/profile_sync_test_util.h" | 18 #include "components/browser_sync/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 using browser_sync::ProfileSyncService; |
| 25 |
24 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( | 26 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( |
25 Profile* profile) { | 27 Profile* profile) { |
26 auto sync_client = base::MakeUnique<browser_sync::ChromeSyncClient>(profile); | 28 auto sync_client = base::MakeUnique<browser_sync::ChromeSyncClient>(profile); |
27 | 29 |
28 sync_client->SetSyncApiComponentFactoryForTesting( | 30 sync_client->SetSyncApiComponentFactoryForTesting( |
29 base::MakeUnique<SyncApiComponentFactoryMock>()); | 31 base::MakeUnique<SyncApiComponentFactoryMock>()); |
30 | 32 |
31 ProfileSyncService::InitParams init_params = | 33 ProfileSyncService::InitParams init_params = |
32 CreateProfileSyncServiceParamsForTest(std::move(sync_client), profile); | 34 CreateProfileSyncServiceParamsForTest(std::move(sync_client), profile); |
33 | 35 |
(...skipping 28 matching lines...) Expand all Loading... |
62 | 64 |
63 std::unique_ptr<TestingProfile> MakeSignedInTestingProfile() { | 65 std::unique_ptr<TestingProfile> MakeSignedInTestingProfile() { |
64 auto profile = base::MakeUnique<TestingProfile>(); | 66 auto profile = base::MakeUnique<TestingProfile>(); |
65 SigninManagerFactory::GetForProfile(profile.get()) | 67 SigninManagerFactory::GetForProfile(profile.get()) |
66 ->SetAuthenticatedAccountInfo("12345", "foo"); | 68 ->SetAuthenticatedAccountInfo("12345", "foo"); |
67 return profile; | 69 return profile; |
68 } | 70 } |
69 | 71 |
70 std::unique_ptr<KeyedService> BuildMockProfileSyncService( | 72 std::unique_ptr<KeyedService> BuildMockProfileSyncService( |
71 content::BrowserContext* context) { | 73 content::BrowserContext* context) { |
72 return base::MakeUnique<ProfileSyncServiceMock>( | 74 return base::MakeUnique<browser_sync::ProfileSyncServiceMock>( |
73 CreateProfileSyncServiceParamsForTest( | 75 CreateProfileSyncServiceParamsForTest( |
74 Profile::FromBrowserContext(context))); | 76 Profile::FromBrowserContext(context))); |
75 } | 77 } |
OLD | NEW |