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" |
(...skipping 10 matching lines...) Expand all Loading... |
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; | 24 using browser_sync::ProfileSyncService; |
25 | 25 |
26 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( | 26 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( |
27 Profile* profile) { | 27 Profile* profile) { |
28 auto sync_client = base::MakeUnique<browser_sync::ChromeSyncClient>(profile); | 28 auto sync_client = base::MakeUnique<browser_sync::ChromeSyncClient>(profile); |
29 | 29 |
30 sync_client->SetSyncApiComponentFactoryForTesting( | 30 sync_client->SetSyncApiComponentFactoryForTesting( |
31 base::MakeUnique<SyncApiComponentFactoryMock>()); | 31 base::MakeUnique<syncer::SyncApiComponentFactoryMock>()); |
32 | 32 |
33 ProfileSyncService::InitParams init_params = | 33 ProfileSyncService::InitParams init_params = |
34 CreateProfileSyncServiceParamsForTest(std::move(sync_client), profile); | 34 CreateProfileSyncServiceParamsForTest(std::move(sync_client), profile); |
35 | 35 |
36 return init_params; | 36 return init_params; |
37 } | 37 } |
38 | 38 |
39 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( | 39 ProfileSyncService::InitParams CreateProfileSyncServiceParamsForTest( |
40 std::unique_ptr<sync_driver::SyncClient> sync_client, | 40 std::unique_ptr<syncer::SyncClient> sync_client, |
41 Profile* profile) { | 41 Profile* profile) { |
42 ProfileSyncService::InitParams init_params; | 42 ProfileSyncService::InitParams init_params; |
43 | 43 |
44 init_params.signin_wrapper = base::MakeUnique<SigninManagerWrapper>( | 44 init_params.signin_wrapper = base::MakeUnique<SigninManagerWrapper>( |
45 SigninManagerFactory::GetForProfile(profile)); | 45 SigninManagerFactory::GetForProfile(profile)); |
46 init_params.oauth2_token_service = | 46 init_params.oauth2_token_service = |
47 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 47 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
48 init_params.start_behavior = ProfileSyncService::MANUAL_START; | 48 init_params.start_behavior = ProfileSyncService::MANUAL_START; |
49 init_params.sync_client = std::move(sync_client); | 49 init_params.sync_client = std::move(sync_client); |
50 init_params.network_time_update_callback = | 50 init_params.network_time_update_callback = |
(...skipping 17 matching lines...) Expand all Loading... |
68 ->SetAuthenticatedAccountInfo("12345", "foo"); | 68 ->SetAuthenticatedAccountInfo("12345", "foo"); |
69 return profile; | 69 return profile; |
70 } | 70 } |
71 | 71 |
72 std::unique_ptr<KeyedService> BuildMockProfileSyncService( | 72 std::unique_ptr<KeyedService> BuildMockProfileSyncService( |
73 content::BrowserContext* context) { | 73 content::BrowserContext* context) { |
74 return base::MakeUnique<browser_sync::ProfileSyncServiceMock>( | 74 return base::MakeUnique<browser_sync::ProfileSyncServiceMock>( |
75 CreateProfileSyncServiceParamsForTest( | 75 CreateProfileSyncServiceParamsForTest( |
76 Profile::FromBrowserContext(context))); | 76 Profile::FromBrowserContext(context))); |
77 } | 77 } |
OLD | NEW |