diff options
author | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 23:21:26 +0000 |
---|---|---|
committer | rogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 23:21:26 +0000 |
commit | cb0323daa02f22887431814b45f87edc365a5853 (patch) | |
tree | 38b9aad479df7dd77aff6e34f1051db09bc42981 /chrome/test/base | |
parent | 052ed9cbe4bff2063fe407d6c77c2f1104a3167a (diff) | |
download | chromium_src-cb0323daa02f22887431814b45f87edc365a5853.zip chromium_src-cb0323daa02f22887431814b45f87edc365a5853.tar.gz chromium_src-cb0323daa02f22887431814b45f87edc365a5853.tar.bz2 |
This is the fourth CL of several that will eventually replace TokenService with
ProfileOAuth2TokenService. In this CL, the dependencies on TS are removed
from chromeos code and managed user code.
BUG=305247
TBR=rlp@chromium.org,davemoore@chromium.org,asvitkine@chromium.org
Review URL: https://codereview.chromium.org/59883010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236865 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base')
-rw-r--r-- | chrome/test/base/testing_profile_manager.cc | 12 | ||||
-rw-r--r-- | chrome/test/base/testing_profile_manager.h | 14 |
2 files changed, 18 insertions, 8 deletions
diff --git a/chrome/test/base/testing_profile_manager.cc b/chrome/test/base/testing_profile_manager.cc index 15d7bbc..048fbff 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) { diff --git a/chrome/test/base/testing_profile_manager.h b/chrome/test/base/testing_profile_manager.h index 01f3317..c2af62a 100644 --- a/chrome/test/base/testing_profile_manager.h +++ b/chrome/test/base/testing_profile_manager.h @@ -14,6 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/string16.h" #include "chrome/test/base/scoped_testing_local_state.h" +#include "chrome/test/base/testing_profile.h" class PrefServiceSyncable; class ProfileInfoCache; @@ -47,11 +48,14 @@ class TestingProfileManager { // ProfileInfoCache and provide the user-visible profile metadata. This will // register the TestingProfile with the profile subsystem as well. The // subsystem owns the Profile and returns a weak pointer. - TestingProfile* CreateTestingProfile(const std::string& profile_name, - scoped_ptr<PrefServiceSyncable> prefs, - const string16& user_name, - int avatar_id, - const std::string& managed_user_id); + // |factories| contains BCKSs to use with the newly created profile. + TestingProfile* CreateTestingProfile( + const std::string& profile_name, + scoped_ptr<PrefServiceSyncable> prefs, + const string16& user_name, + int avatar_id, + const std::string& managed_user_id, + const TestingProfile::TestingFactories& factories); // Small helper for creating testing profiles. Just forwards to above. TestingProfile* CreateTestingProfile(const std::string& name); |