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

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

Issue 8665011: sync: remove GetAuthenticatedUsername from ProfileSyncService/SyncBackendHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review2 Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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/prefs/pref_service_mock_builder.h"
6 #include "chrome/browser/prefs/testing_pref_store.h"
5 #include "chrome/browser/sync/profile_sync_service_mock.h" 7 #include "chrome/browser/sync/profile_sync_service_mock.h"
6 #include "chrome/browser/sync/signin_manager.h" 8 #include "chrome/browser/sync/signin_manager.h"
7 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 9 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
10 #include "chrome/common/pref_names.h"
8 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
12 #include "chrome/test/base/testing_profile.h"
9 13
10 ProfileSyncServiceMock::ProfileSyncServiceMock() 14 ProfileSyncServiceMock::ProfileSyncServiceMock()
11 : ProfileSyncService(NULL, NULL, new SigninManager(), "") { 15 : ProfileSyncService(NULL, NULL, new SigninManager(), "") {
12 } 16 }
13 17
18 ProfileSyncServiceMock::ProfileSyncServiceMock(
19 Profile* profile) : ProfileSyncService(NULL, profile, NULL, "") {
20 }
21
14 ProfileSyncServiceMock::~ProfileSyncServiceMock() { 22 ProfileSyncServiceMock::~ProfileSyncServiceMock() {
15 } 23 }
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_mock.h ('k') | chrome/browser/sync/sync_global_error_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698