blob: 173a1a1ad0533a63c3f0f6ced870698ff0580357 [file] [log] [blame]
[email protected]33392292011-01-05 17:56:391// 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]6a108f82011-12-02 05:25:385#include "chrome/browser/prefs/pref_service_mock_builder.h"
6#include "chrome/browser/prefs/testing_pref_store.h"
[email protected]33392292011-01-05 17:56:397#include "chrome/browser/sync/profile_sync_service_mock.h"
[email protected]62828b12011-07-21 21:48:168#include "chrome/browser/sync/signin_manager.h"
[email protected]fd42ac30f2011-02-27 19:33:369#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
[email protected]6a108f82011-12-02 05:25:3810#include "chrome/common/pref_names.h"
[email protected]e9a6ff42011-01-27 20:17:2411#include "chrome/common/url_constants.h"
[email protected]6a108f82011-12-02 05:25:3812#include "chrome/test/base/testing_profile.h"
[email protected]33392292011-01-05 17:56:3913
[email protected]dd50906e2011-03-29 19:01:1314ProfileSyncServiceMock::ProfileSyncServiceMock()
[email protected]62828b12011-07-21 21:48:1615 : ProfileSyncService(NULL, NULL, new SigninManager(), "") {
[email protected]dd50906e2011-03-29 19:01:1316}
[email protected]33392292011-01-05 17:56:3917
[email protected]6a108f82011-12-02 05:25:3818ProfileSyncServiceMock::ProfileSyncServiceMock(
19 Profile* profile) : ProfileSyncService(NULL, profile, NULL, "") {
20}
21
[email protected]e9a6ff42011-01-27 20:17:2422ProfileSyncServiceMock::~ProfileSyncServiceMock() {
[email protected]e9a6ff42011-01-27 20:17:2423}
[email protected]6a108f82011-12-02 05:25:3824
25// static
26Profile* 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}