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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 init_params.oauth2_token_service = | 48 init_params.oauth2_token_service = |
49 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 49 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
50 init_params.start_behavior = ProfileSyncService::MANUAL_START; | 50 init_params.start_behavior = ProfileSyncService::MANUAL_START; |
51 init_params.sync_client = std::move(sync_client); | 51 init_params.sync_client = std::move(sync_client); |
52 init_params.network_time_update_callback = | 52 init_params.network_time_update_callback = |
53 base::Bind(&browser_sync::EmptyNetworkTimeUpdate); | 53 base::Bind(&browser_sync::EmptyNetworkTimeUpdate); |
54 init_params.base_directory = profile->GetPath(); | 54 init_params.base_directory = profile->GetPath(); |
55 init_params.url_request_context = profile->GetRequestContext(); | 55 init_params.url_request_context = profile->GetRequestContext(); |
56 init_params.debug_identifier = profile->GetDebugName(); | 56 init_params.debug_identifier = profile->GetDebugName(); |
57 init_params.channel = chrome::GetChannel(); | 57 init_params.channel = chrome::GetChannel(); |
58 base::SequencedWorkerPool* blocking_pool = | |
59 content::BrowserThread::GetBlockingPool(); | |
60 init_params.blocking_task_runner = | |
61 blocking_pool->GetSequencedTaskRunnerWithShutdownBehavior( | |
62 blocking_pool->GetSequenceToken(), | |
63 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | |
64 | 58 |
65 return init_params; | 59 return init_params; |
66 } | 60 } |
67 | 61 |
68 std::unique_ptr<TestingProfile> MakeSignedInTestingProfile() { | 62 std::unique_ptr<TestingProfile> MakeSignedInTestingProfile() { |
69 auto profile = base::MakeUnique<TestingProfile>(); | 63 auto profile = base::MakeUnique<TestingProfile>(); |
70 SigninManagerFactory::GetForProfile(profile.get()) | 64 SigninManagerFactory::GetForProfile(profile.get()) |
71 ->SetAuthenticatedAccountInfo("12345", "foo"); | 65 ->SetAuthenticatedAccountInfo("12345", "foo"); |
72 return profile; | 66 return profile; |
73 } | 67 } |
74 | 68 |
75 std::unique_ptr<KeyedService> BuildMockProfileSyncService( | 69 std::unique_ptr<KeyedService> BuildMockProfileSyncService( |
76 content::BrowserContext* context) { | 70 content::BrowserContext* context) { |
77 return base::MakeUnique<browser_sync::ProfileSyncServiceMock>( | 71 return base::MakeUnique<browser_sync::ProfileSyncServiceMock>( |
78 CreateProfileSyncServiceParamsForTest( | 72 CreateProfileSyncServiceParamsForTest( |
79 Profile::FromBrowserContext(context))); | 73 Profile::FromBrowserContext(context))); |
80 } | 74 } |
OLD | NEW |