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

Unified Diff: chrome/test/base/testing_profile_manager.cc

Issue 59883010: This is the fourth CL of several that will eventually replace TokenService with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/testing_profile_manager.cc
diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc
index a5ef121bfef22fe2eba3e14d1a0fb8591d76626f..aa73144bab2b0982e81520a9d3f039e31c98f7c9 100644
--- a/chrome/test/base/testing_profile_manager.cc
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/test/base/testing_browser_process.h"
-#include "chrome/test/base/testing_profile.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace testing {
@@ -44,12 +43,13 @@ bool TestingProfileManager::SetUp() {
return called_set_up_;
}
-TestingProfile* TestingProfileManager::CreateTestingProfile(
+TestingProfile* TestingProfileManager::CreateTestingProfileWithFactories(
const std::string& profile_name,
scoped_ptr<PrefServiceSyncable> prefs,
const string16& user_name,
int avatar_id,
- const std::string& managed_user_id) {
+ const std::string& managed_user_id,
+ const TestingProfile::TestingFactories& factories) {
DCHECK(called_set_up_);
// Create a path for the profile based on the name.
@@ -62,6 +62,11 @@ TestingProfile* TestingProfileManager::CreateTestingProfile(
builder.SetPrefService(prefs.Pass());
builder.SetManagedUserId(managed_user_id);
+ for (TestingProfile::TestingFactories::const_iterator it = factories.begin();
+ it != factories.end(); ++it) {
+ builder.AddTestingFactory(it->first, it->second);
+ }
+
TestingProfile* profile = builder.Build().release();
profile_manager_->AddProfile(profile); // Takes ownership.
@@ -80,6 +85,17 @@ TestingProfile* TestingProfileManager::CreateTestingProfile(
}
TestingProfile* TestingProfileManager::CreateTestingProfile(
+ const std::string& profile_name,
+ scoped_ptr<PrefServiceSyncable> prefs,
+ const string16& user_name,
+ int avatar_id,
+ const std::string& managed_user_id) {
+ return CreateTestingProfileWithFactories(
+ profile_name, prefs.Pass(), user_name, avatar_id, managed_user_id,
+ TestingProfile::TestingFactories());
+}
+
+TestingProfile* TestingProfileManager::CreateTestingProfile(
const std::string& name) {
DCHECK(called_set_up_);
return CreateTestingProfile(name, scoped_ptr<PrefServiceSyncable>(),
« chrome/test/base/testing_profile_manager.h ('K') | « chrome/test/base/testing_profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698