Index: chrome/test/base/testing_profile.cc |
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc |
index fa809eb0383843bc70a612d50a345fc686818480..194a9ced33385cc8a4bd3c3347ae6ebae0bee182 100644 |
--- a/chrome/test/base/testing_profile.cc |
+++ b/chrome/test/base/testing_profile.cc |
@@ -162,6 +162,7 @@ TestingProfile::TestingProfile() |
: start_time_(Time::Now()), |
testing_prefs_(NULL), |
incognito_(false), |
+ original_profile_(NULL), |
last_session_exited_cleanly_(true), |
profile_dependency_manager_(ProfileDependencyManager::GetInstance()), |
delegate_(NULL) { |
@@ -176,6 +177,7 @@ TestingProfile::TestingProfile(const FilePath& path) |
: start_time_(Time::Now()), |
testing_prefs_(NULL), |
incognito_(false), |
+ original_profile_(NULL), |
last_session_exited_cleanly_(true), |
profile_path_(path), |
profile_dependency_manager_(ProfileDependencyManager::GetInstance()), |
@@ -189,6 +191,7 @@ TestingProfile::TestingProfile(const FilePath& path, |
: start_time_(Time::Now()), |
testing_prefs_(NULL), |
incognito_(false), |
+ original_profile_(NULL), |
last_session_exited_cleanly_(true), |
profile_path_(path), |
profile_dependency_manager_(ProfileDependencyManager::GetInstance()), |
@@ -213,6 +216,7 @@ TestingProfile::TestingProfile( |
prefs_(prefs.release()), |
testing_prefs_(NULL), |
incognito_(off_the_record), |
+ original_profile_(NULL), |
last_session_exited_cleanly_(true), |
extension_special_storage_policy_(extension_policy), |
profile_path_(path), |
@@ -499,6 +503,10 @@ void TestingProfile::SetOffTheRecordProfile(Profile* profile) { |
incognito_profile_.reset(profile); |
} |
+void TestingProfile::SetOriginalProfile(Profile* profile) { |
+ original_profile_ = profile; |
+} |
+ |
Profile* TestingProfile::GetOffTheRecordProfile() { |
return incognito_profile_.get(); |
} |
@@ -508,6 +516,8 @@ bool TestingProfile::HasOffTheRecordProfile() { |
} |
Profile* TestingProfile::GetOriginalProfile() { |
+ if (original_profile_) |
+ return original_profile_; |
return this; |
} |