Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(628)

Side by Side Diff: chrome/browser/sync/profile_sync_service_mock.cc

Issue 1451023005: Revert of [Sync] Componentize ProfileSyncComponentsFactoryImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/profile_sync_service_mock.h" 5 #include "chrome/browser/sync/profile_sync_service_mock.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/prefs/testing_pref_store.h" 8 #include "base/prefs/testing_pref_store.h"
9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
10 #include "chrome/browser/signin/signin_manager_factory.h" 10 #include "chrome/browser/signin/signin_manager_factory.h"
11 #include "chrome/browser/sync/chrome_sync_client.h" 11 #include "chrome/browser/sync/chrome_sync_client.h"
12 #include "chrome/browser/sync/profile_sync_test_util.h" 12 #include "chrome/browser/sync/profile_sync_test_util.h"
13 #include "chrome/common/channel_info.h" 13 #include "chrome/common/channel_info.h"
14 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
15 #include "chrome/common/url_constants.h" 15 #include "chrome/common/url_constants.h"
16 #include "chrome/test/base/testing_profile.h" 16 #include "chrome/test/base/testing_profile.h"
17 #include "components/signin/core/browser/profile_oauth2_token_service.h" 17 #include "components/signin/core/browser/profile_oauth2_token_service.h"
18 #include "components/signin/core/browser/signin_manager.h" 18 #include "components/signin/core/browser/signin_manager.h"
19 #include "components/sync_driver/signin_manager_wrapper.h" 19 #include "components/sync_driver/signin_manager_wrapper.h"
20 #include "components/sync_driver/sync_api_component_factory_mock.h" 20 #include "components/sync_driver/sync_api_component_factory_mock.h"
21 21
22 ProfileSyncServiceMock::ProfileSyncServiceMock(Profile* profile) 22 ProfileSyncServiceMock::ProfileSyncServiceMock(Profile* profile)
23 : ProfileSyncServiceMock( 23 : ProfileSyncServiceMock(
24 make_scoped_ptr(new browser_sync::ChromeSyncClient(profile)), 24 make_scoped_ptr(
25 profile) { 25 new browser_sync::ChromeSyncClient(
26 static_cast<browser_sync::ChromeSyncClient*>(GetSyncClient()) 26 profile,
27 ->SetSyncApiComponentFactoryForTesting( 27 make_scoped_ptr(new SyncApiComponentFactoryMock())))
28 make_scoped_ptr(new SyncApiComponentFactoryMock())); 28 .Pass(),
29 } 29 profile) {}
30 30
31 ProfileSyncServiceMock::ProfileSyncServiceMock( 31 ProfileSyncServiceMock::ProfileSyncServiceMock(
32 scoped_ptr<sync_driver::SyncClient> sync_client, 32 scoped_ptr<sync_driver::SyncClient> sync_client,
33 Profile* profile) 33 Profile* profile)
34 : ProfileSyncService( 34 : ProfileSyncService(
35 sync_client.Pass(), 35 sync_client.Pass(),
36 make_scoped_ptr(new SigninManagerWrapper( 36 make_scoped_ptr(new SigninManagerWrapper(
37 SigninManagerFactory::GetForProfile(profile))), 37 SigninManagerFactory::GetForProfile(profile))),
38 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), 38 ProfileOAuth2TokenServiceFactory::GetForProfile(profile),
39 browser_sync::MANUAL_START, 39 browser_sync::MANUAL_START,
(...skipping 20 matching lines...) Expand all
60 SetAuthenticatedAccountInfo("12345", "foo"); 60 SetAuthenticatedAccountInfo("12345", "foo");
61 return profile; 61 return profile;
62 } 62 }
63 63
64 // static 64 // static
65 scoped_ptr<KeyedService> ProfileSyncServiceMock::BuildMockProfileSyncService( 65 scoped_ptr<KeyedService> ProfileSyncServiceMock::BuildMockProfileSyncService(
66 content::BrowserContext* profile) { 66 content::BrowserContext* profile) {
67 return make_scoped_ptr( 67 return make_scoped_ptr(
68 new ProfileSyncServiceMock(static_cast<Profile*>(profile))); 68 new ProfileSyncServiceMock(static_cast<Profile*>(profile)));
69 } 69 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698