| Index: chrome/test/base/testing_profile.cc
|
| diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
|
| index 943b927e2c7b13d187010018dfd507a7fce8f391..90bab6b3f4592402c216e505f624fc4d430ebc44 100644
|
| --- a/chrome/test/base/testing_profile.cc
|
| +++ b/chrome/test/base/testing_profile.cc
|
| @@ -688,7 +688,8 @@ bool TestingProfile::IsOffTheRecord() const {
|
|
|
| void TestingProfile::SetOffTheRecordProfile(std::unique_ptr<Profile> profile) {
|
| DCHECK(!IsOffTheRecord());
|
| - DCHECK_EQ(this, profile->GetOriginalProfile());
|
| + if (profile)
|
| + DCHECK_EQ(this, profile->GetOriginalProfile());
|
| incognito_profile_ = std::move(profile);
|
| }
|
|
|
| @@ -867,8 +868,11 @@ content::PushMessagingService* TestingProfile::GetPushMessagingService() {
|
| return NULL;
|
| }
|
|
|
| -bool TestingProfile::IsSameProfile(Profile *p) {
|
| - return this == p;
|
| +bool TestingProfile::IsSameProfile(Profile *profile) {
|
| + if (this == profile)
|
| + return true;
|
| + Profile* otr_profile = incognito_profile_.get();
|
| + return otr_profile && profile == otr_profile;
|
| }
|
|
|
| base::Time TestingProfile::GetStartTime() const {
|
|
|