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

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

Issue 847733005: Move User Manager onto a System profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 months 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/test/base/testing_profile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63295182710194961813fe246e05013f63ed4b3a..064a681dad1d249ab4c14d5a6a34a6a0262398ff 100644
--- a/chrome/test/base/testing_profile_manager.cc
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -18,6 +18,7 @@
#endif
const char kGuestProfileName[] = "Guest";
+const char kSystemProfileName[] = "System";
namespace testing {
@@ -136,6 +137,24 @@ TestingProfile* TestingProfileManager::CreateGuestProfile() {
return profile;
}
+TestingProfile* TestingProfileManager::CreateSystemProfile() {
+ DCHECK(called_set_up_);
+
+ // Create the profile and register it.
+ TestingProfile::Builder builder;
+ builder.SetPath(ProfileManager::GetSystemProfilePath());
+
+ // Add the system profile to the profile manager, but not to the info cache.
+ TestingProfile* profile = builder.Build().release();
+ profile->set_profile_name(kSystemProfileName);
+
+ profile_manager_->AddProfile(profile); // Takes ownership.
+
+ testing_profiles_.insert(std::make_pair(kSystemProfileName, profile));
+
+ return profile;
+}
+
void TestingProfileManager::DeleteTestingProfile(const std::string& name) {
DCHECK(called_set_up_);
@@ -170,6 +189,16 @@ void TestingProfileManager::DeleteGuestProfile() {
profile_manager_->profiles_info_.erase(ProfileManager::GetGuestProfilePath());
}
+void TestingProfileManager::DeleteSystemProfile() {
+ DCHECK(called_set_up_);
+
+ TestingProfilesMap::iterator it = testing_profiles_.find(kSystemProfileName);
+ DCHECK(it != testing_profiles_.end());
+
+ profile_manager_->profiles_info_.erase(
+ ProfileManager::GetSystemProfilePath());
+}
+
void TestingProfileManager::DeleteProfileInfoCache() {
profile_manager_->profile_info_cache_.reset(NULL);
}
« no previous file with comments | « 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