Index: chrome/test/base/testing_profile.cc |
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc |
index d40d38394eb1e75a7079e74b0579c56b530166ff..4941c55a1a977bfb0bf1940698340c3337cfe74e 100644 |
--- a/chrome/test/base/testing_profile.cc |
+++ b/chrome/test/base/testing_profile.cc |
@@ -598,6 +598,13 @@ void TestingProfile::SetOriginalProfile(Profile* profile) { |
Profile* TestingProfile::GetOffTheRecordProfile() { |
if (IsOffTheRecord()) |
return this; |
+ if (!incognito_profile_) { |
+ TestingProfile::Builder builder; |
+ builder.SetIncognito(); |
+ scoped_ptr<TestingProfile> incognito_test_profile(builder.Build()); |
+ incognito_test_profile->SetOriginalProfile(this); |
+ SetOffTheRecordProfile(incognito_test_profile.PassAs<Profile>()); |
+ } |
return incognito_profile_.get(); |
} |