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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_service_mock.cc
diff --git a/chrome/browser/sync/profile_sync_service_mock.cc b/chrome/browser/sync/profile_sync_service_mock.cc
index 638a464521d181574ae60922343ce4dd33195a36..173a1a1ad0533a63c3f0f6ced870698ff0580357 100644
--- a/chrome/browser/sync/profile_sync_service_mock.cc
+++ b/chrome/browser/sync/profile_sync_service_mock.cc
@@ -2,14 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/browser/prefs/pref_service_mock_builder.h"
+#include "chrome/browser/prefs/testing_pref_store.h"
#include "chrome/browser/sync/profile_sync_service_mock.h"
#include "chrome/browser/sync/signin_manager.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
+#include "chrome/test/base/testing_profile.h"
ProfileSyncServiceMock::ProfileSyncServiceMock()
: ProfileSyncService(NULL, NULL, new SigninManager(), "") {
}
+ProfileSyncServiceMock::ProfileSyncServiceMock(
+ Profile* profile) : ProfileSyncService(NULL, profile, NULL, "") {
+}
+
ProfileSyncServiceMock::~ProfileSyncServiceMock() {
}
+
+// static
+Profile* ProfileSyncServiceMock::MakeSignedInTestingProfile() {
+ TestingProfile* profile = new TestingProfile();
+ TestingPrefStore* user_prefs = new TestingPrefStore();
+ PrefService* prefs = PrefServiceMockBuilder()
+ .WithUserPrefs(user_prefs)
+ .Create();
+ profile->SetPrefService(prefs);
+ SigninManager::RegisterUserPrefs(prefs);
+ user_prefs->SetString(prefs::kGoogleServicesUsername, "foo");
+ return profile;
+}
« 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