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

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

Issue 2298283002: Site Settings Desktop: Support adding exceptions for incognito mode. (Closed)
Patch Set: Fix test Created 4 years, 3 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/test/base/testing_profile.h ('k') | chrome/test/data/webui/settings/site_list_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « chrome/test/base/testing_profile.h ('k') | chrome/test/data/webui/settings/site_list_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698