Index: chrome/test/base/testing_profile.cc |
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc |
index e9800b7d2727bbfbbe1122744dfa50ae784c2d3f..756fd340af975188d84434423715ea40fff1a1c3 100644 |
--- a/chrome/test/base/testing_profile.cc |
+++ b/chrome/test/base/testing_profile.cc |
@@ -161,6 +161,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) { |
@@ -175,6 +176,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()), |
@@ -188,6 +190,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()), |
@@ -212,6 +215,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), |
@@ -498,6 +502,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(); |
} |
@@ -507,6 +515,8 @@ bool TestingProfile::HasOffTheRecordProfile() { |
} |
Profile* TestingProfile::GetOriginalProfile() { |
+ if (original_profile_) |
+ return original_profile_; |
return this; |
} |