OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test_profile_sync_service.h" | 5 #include "chrome/browser/sync/test_profile_sync_service.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 10 #include "base/thread_task_runner_handle.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" | 12 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 14 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
15 #include "chrome/browser/signin/signin_manager_factory.h" | 15 #include "chrome/browser/signin/signin_manager_factory.h" |
16 #include "chrome/browser/sync/chrome_sync_client.h" | 16 #include "chrome/browser/sync/chrome_sync_client.h" |
17 #include "chrome/browser/sync/glue/sync_backend_host.h" | 17 #include "chrome/browser/sync/glue/sync_backend_host.h" |
18 #include "chrome/browser/sync/glue/sync_backend_host_core.h" | 18 #include "chrome/browser/sync/glue/sync_backend_host_core.h" |
19 #include "chrome/browser/sync/profile_sync_service_factory.h" | 19 #include "chrome/browser/sync/profile_sync_service_factory.h" |
20 #include "chrome/browser/sync/profile_sync_test_util.h" | 20 #include "chrome/browser/sync/profile_sync_test_util.h" |
21 #include "chrome/browser/sync/test/test_http_bridge_factory.h" | 21 #include "chrome/browser/sync/test/test_http_bridge_factory.h" |
| 22 #include "chrome/common/channel_info.h" |
22 #include "components/invalidation/impl/profile_invalidation_provider.h" | 23 #include "components/invalidation/impl/profile_invalidation_provider.h" |
23 #include "components/signin/core/browser/signin_manager.h" | 24 #include "components/signin/core/browser/signin_manager.h" |
24 #include "components/sync_driver/signin_manager_wrapper.h" | 25 #include "components/sync_driver/signin_manager_wrapper.h" |
25 #include "components/sync_driver/sync_api_component_factory_mock.h" | 26 #include "components/sync_driver/sync_api_component_factory_mock.h" |
26 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
27 #include "google_apis/gaia/gaia_constants.h" | 28 #include "google_apis/gaia/gaia_constants.h" |
28 #include "sync/internal_api/public/test/sync_manager_factory_for_profile_sync_te
st.h" | 29 #include "sync/internal_api/public/test/sync_manager_factory_for_profile_sync_te
st.h" |
29 #include "sync/internal_api/public/test/test_internal_components_factory.h" | 30 #include "sync/internal_api/public/test/test_internal_components_factory.h" |
30 #include "sync/internal_api/public/user_share.h" | 31 #include "sync/internal_api/public/user_share.h" |
31 #include "sync/protocol/encryption.pb.h" | 32 #include "sync/protocol/encryption.pb.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 SigninManagerBase* signin, | 127 SigninManagerBase* signin, |
127 ProfileOAuth2TokenService* oauth2_token_service, | 128 ProfileOAuth2TokenService* oauth2_token_service, |
128 browser_sync::ProfileSyncServiceStartBehavior behavior) | 129 browser_sync::ProfileSyncServiceStartBehavior behavior) |
129 : ProfileSyncService(make_scoped_ptr(new browser_sync::ChromeSyncClient( | 130 : ProfileSyncService(make_scoped_ptr(new browser_sync::ChromeSyncClient( |
130 profile, | 131 profile, |
131 make_scoped_ptr(new SyncApiComponentFactoryMock))), | 132 make_scoped_ptr(new SyncApiComponentFactoryMock))), |
132 profile, | 133 profile, |
133 make_scoped_ptr(new SigninManagerWrapper(signin)), | 134 make_scoped_ptr(new SigninManagerWrapper(signin)), |
134 oauth2_token_service, | 135 oauth2_token_service, |
135 behavior, | 136 behavior, |
136 base::Bind(&EmptyNetworkTimeUpdate)) { | 137 base::Bind(&EmptyNetworkTimeUpdate), |
| 138 profile->GetPath(), |
| 139 profile->GetRequestContext(), |
| 140 profile->GetDebugName(), |
| 141 chrome::GetChannel(), |
| 142 content::BrowserThread::GetMessageLoopProxyForThread( |
| 143 content::BrowserThread::DB), |
| 144 content::BrowserThread::GetMessageLoopProxyForThread( |
| 145 content::BrowserThread::FILE), |
| 146 content::BrowserThread::GetBlockingPool()) { |
137 SetSyncSetupCompleted(); | 147 SetSyncSetupCompleted(); |
138 } | 148 } |
139 | 149 |
140 TestProfileSyncService::~TestProfileSyncService() { | 150 TestProfileSyncService::~TestProfileSyncService() { |
141 } | 151 } |
142 | 152 |
143 // static | 153 // static |
144 scoped_ptr<KeyedService> TestProfileSyncService::TestFactoryFunction( | 154 scoped_ptr<KeyedService> TestProfileSyncService::TestFactoryFunction( |
145 content::BrowserContext* context) { | 155 content::BrowserContext* context) { |
146 Profile* profile = static_cast<Profile*>(context); | 156 Profile* profile = static_cast<Profile*>(context); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 base::MessageLoop::current()->QuitWhenIdle(); | 198 base::MessageLoop::current()->QuitWhenIdle(); |
189 } | 199 } |
190 | 200 |
191 UserShare* TestProfileSyncService::GetUserShare() const { | 201 UserShare* TestProfileSyncService::GetUserShare() const { |
192 return backend_->GetUserShare(); | 202 return backend_->GetUserShare(); |
193 } | 203 } |
194 | 204 |
195 bool TestProfileSyncService::NeedBackup() const { | 205 bool TestProfileSyncService::NeedBackup() const { |
196 return false; | 206 return false; |
197 } | 207 } |
OLD | NEW |