[email protected] | 3339229 | 2011-01-05 17:56:39 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 6a108f8 | 2011-12-02 05:25:38 | [diff] [blame^] | 5 | #include "chrome/browser/prefs/pref_service_mock_builder.h" |
6 | #include "chrome/browser/prefs/testing_pref_store.h" | ||||
[email protected] | 3339229 | 2011-01-05 17:56:39 | [diff] [blame] | 7 | #include "chrome/browser/sync/profile_sync_service_mock.h" |
[email protected] | 62828b1 | 2011-07-21 21:48:16 | [diff] [blame] | 8 | #include "chrome/browser/sync/signin_manager.h" |
[email protected] | fd42ac30f | 2011-02-27 19:33:36 | [diff] [blame] | 9 | #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
[email protected] | 6a108f8 | 2011-12-02 05:25:38 | [diff] [blame^] | 10 | #include "chrome/common/pref_names.h" |
[email protected] | e9a6ff4 | 2011-01-27 20:17:24 | [diff] [blame] | 11 | #include "chrome/common/url_constants.h" |
[email protected] | 6a108f8 | 2011-12-02 05:25:38 | [diff] [blame^] | 12 | #include "chrome/test/base/testing_profile.h" |
[email protected] | 3339229 | 2011-01-05 17:56:39 | [diff] [blame] | 13 | |
[email protected] | dd50906e | 2011-03-29 19:01:13 | [diff] [blame] | 14 | ProfileSyncServiceMock::ProfileSyncServiceMock() |
[email protected] | 62828b1 | 2011-07-21 21:48:16 | [diff] [blame] | 15 | : ProfileSyncService(NULL, NULL, new SigninManager(), "") { |
[email protected] | dd50906e | 2011-03-29 19:01:13 | [diff] [blame] | 16 | } |
[email protected] | 3339229 | 2011-01-05 17:56:39 | [diff] [blame] | 17 | |
[email protected] | 6a108f8 | 2011-12-02 05:25:38 | [diff] [blame^] | 18 | ProfileSyncServiceMock::ProfileSyncServiceMock( |
19 | Profile* profile) : ProfileSyncService(NULL, profile, NULL, "") { | ||||
20 | } | ||||
21 | |||||
[email protected] | e9a6ff4 | 2011-01-27 20:17:24 | [diff] [blame] | 22 | ProfileSyncServiceMock::~ProfileSyncServiceMock() { |
[email protected] | e9a6ff4 | 2011-01-27 20:17:24 | [diff] [blame] | 23 | } |
[email protected] | 6a108f8 | 2011-12-02 05:25:38 | [diff] [blame^] | 24 | |
25 | // static | ||||
26 | Profile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { | ||||
27 | TestingProfile* profile = new TestingProfile(); | ||||
28 | TestingPrefStore* user_prefs = new TestingPrefStore(); | ||||
29 | PrefService* prefs = PrefServiceMockBuilder() | ||||
30 | .WithUserPrefs(user_prefs) | ||||
31 | .Create(); | ||||
32 | profile->SetPrefService(prefs); | ||||
33 | SigninManager::RegisterUserPrefs(prefs); | ||||
34 | user_prefs->SetString(prefs::kGoogleServicesUsername, "foo"); | ||||
35 | return profile; | ||||
36 | } |