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 "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
8 #include "chrome/browser/signin/signin_manager.h" | 8 #include "chrome/browser/signin/signin_manager.h" |
9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
10 #include "chrome/browser/sync/glue/data_type_controller.h" | 10 #include "chrome/browser/sync/glue/data_type_controller.h" |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 synchronous_backend_initialization_, | 312 synchronous_backend_initialization_, |
313 fail_initial_download_, | 313 fail_initial_download_, |
314 storage_option_)); | 314 storage_option_)); |
315 } | 315 } |
316 | 316 |
317 scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest( | 317 scoped_ptr<OAuth2TokenService::Request> FakeOAuth2TokenService::StartRequest( |
318 const OAuth2TokenService::ScopeSet& scopes, | 318 const OAuth2TokenService::ScopeSet& scopes, |
319 OAuth2TokenService::Consumer* consumer) { | 319 OAuth2TokenService::Consumer* consumer) { |
320 // Ensure token in question is cached and never expires. Request will succeed | 320 // Ensure token in question is cached and never expires. Request will succeed |
321 // without network IO. | 321 // without network IO. |
322 RegisterCacheEntry("test_client_id", | 322 RegisterCacheEntry(GetRefreshToken(), scopes, "access_token", |
323 GetRefreshToken(), | 323 base::Time::Max()); |
324 scopes, | |
325 "access_token", | |
326 base::Time::Max()); | |
327 return ProfileOAuth2TokenService::StartRequest(scopes, consumer); | 324 return ProfileOAuth2TokenService::StartRequest(scopes, consumer); |
328 } | 325 } |
329 | 326 |
330 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( | 327 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( |
331 content::BrowserContext* context) { | 328 content::BrowserContext* context) { |
332 Profile* profile = static_cast<Profile*>(context); | 329 Profile* profile = static_cast<Profile*>(context); |
333 | 330 |
334 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); | 331 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); |
335 service->Initialize(profile); | 332 service->Initialize(profile); |
336 return service; | 333 return service; |
337 } | 334 } |
OLD | NEW |