| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 scoped_ptr<syncer::HttpPostProviderFactory> MakeTestHttpBridgeFactory() { | 58 scoped_ptr<syncer::HttpPostProviderFactory> MakeTestHttpBridgeFactory() { |
| 59 return scoped_ptr<syncer::HttpPostProviderFactory>( | 59 return scoped_ptr<syncer::HttpPostProviderFactory>( |
| 60 new browser_sync::TestHttpBridgeFactory()); | 60 new browser_sync::TestHttpBridgeFactory()); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace | 63 } // namespace |
| 64 | 64 |
| 65 void SyncBackendHostForProfileSyncTest::InitCore( | 65 void SyncBackendHostForProfileSyncTest::InitCore( |
| 66 scoped_ptr<DoInitializeOptions> options) { | 66 scoped_ptr<DoInitializeOptions> options) { |
| 67 options->make_http_bridge_factory_fn = | 67 options->http_bridge_factory = MakeTestHttpBridgeFactory(); |
| 68 base::Bind(&MakeTestHttpBridgeFactory); | |
| 69 options->credentials.email = "testuser@gmail.com"; | 68 options->credentials.email = "testuser@gmail.com"; |
| 70 options->credentials.sync_token = "token"; | 69 options->credentials.sync_token = "token"; |
| 71 options->restored_key_for_bootstrapping = ""; | 70 options->restored_key_for_bootstrapping = ""; |
| 72 syncer::StorageOption storage = storage_option_; | 71 syncer::StorageOption storage = storage_option_; |
| 73 | 72 |
| 74 // It'd be nice if we avoided creating the InternalComponentsFactory in the | 73 // It'd be nice if we avoided creating the InternalComponentsFactory in the |
| 75 // first place, but SyncBackendHost will have created one by now so we must | 74 // first place, but SyncBackendHost will have created one by now so we must |
| 76 // free it. Grab the switches to pass on first. | 75 // free it. Grab the switches to pass on first. |
| 77 InternalComponentsFactory::Switches factory_switches = | 76 InternalComponentsFactory::Switches factory_switches = |
| 78 options->internal_components_factory->GetSwitches(); | 77 options->internal_components_factory->GetSwitches(); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 327 } |
| 329 | 328 |
| 330 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( | 329 BrowserContextKeyedService* FakeOAuth2TokenService::BuildTokenService( |
| 331 content::BrowserContext* context) { | 330 content::BrowserContext* context) { |
| 332 Profile* profile = static_cast<Profile*>(context); | 331 Profile* profile = static_cast<Profile*>(context); |
| 333 | 332 |
| 334 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); | 333 FakeOAuth2TokenService* service = new FakeOAuth2TokenService(); |
| 335 service->Initialize(profile); | 334 service->Initialize(profile); |
| 336 return service; | 335 return service; |
| 337 } | 336 } |
| OLD | NEW |