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 15d7bbc9c58b046b5606d13c9fe1bc9840fe5148..048fbff3b1aa0660246f9d5c381bfa27b38d4cf2 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 { |
@@ -49,7 +48,8 @@ TestingProfile* TestingProfileManager::CreateTestingProfile( |
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->set_profile_name(profile_name); |
profile_manager_->AddProfile(profile); // Takes ownership. |
@@ -84,7 +89,8 @@ TestingProfile* TestingProfileManager::CreateTestingProfile( |
const std::string& name) { |
DCHECK(called_set_up_); |
return CreateTestingProfile(name, scoped_ptr<PrefServiceSyncable>(), |
- UTF8ToUTF16(name), 0, std::string()); |
+ UTF8ToUTF16(name), 0, std::string(), |
+ TestingProfile::TestingFactories()); |
} |
void TestingProfileManager::DeleteTestingProfile(const std::string& name) { |