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

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

Issue 187043003: Fixes crashes related to reusing guest mode profiles and/or user manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac tests Created 6 years, 10 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/browser/profiles/profile_manager.cc ('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 2bda8ecb2a00124ec8d99df38d9c8395008629ee..cd3eb5d31884c28c154035e616a4dd4ace359bde 100644
--- a/chrome/test/base/testing_profile_manager.cc
+++ b/chrome/test/base/testing_profile_manager.cc
@@ -101,6 +101,11 @@ TestingProfile* TestingProfileManager::CreateTestingProfile(
TestingProfile* TestingProfileManager::CreateGuestProfile() {
DCHECK(called_set_up_);
+ // Set up a profile with an off the record profile.
+ TestingProfile::Builder otr_builder;
+ otr_builder.SetIncognito();
+ scoped_ptr<TestingProfile> otr_profile(otr_builder.Build());
+
// Create the profile and register it.
TestingProfile::Builder builder;
builder.SetGuestSession();
@@ -109,6 +114,9 @@ TestingProfile* TestingProfileManager::CreateGuestProfile() {
// Add the guest profile to the profile manager, but not to the info cache.
TestingProfile* profile = builder.Build().release();
profile->set_profile_name(kGuestProfileName);
+
+ otr_profile->SetOriginalProfile(profile);
+ profile->SetOffTheRecordProfile(otr_profile.PassAs<Profile>());
profile_manager_->AddProfile(profile); // Takes ownership.
profile_manager_->SetGuestProfilePrefs(profile);
« no previous file with comments | « chrome/browser/profiles/profile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698