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>(), |