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

Unified Diff: chrome/browser/extensions/event_router_forwarder_unittest.cc

Issue 181403006: Make TestingProfile auto-create incognito profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove broken and no-longer-applicable test Created 6 years, 9 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
Index: chrome/browser/extensions/event_router_forwarder_unittest.cc
diff --git a/chrome/browser/extensions/event_router_forwarder_unittest.cc b/chrome/browser/extensions/event_router_forwarder_unittest.cc
index 865d74b11551c6c9616c87b2f0efefc5fc5381b0..faf51fb8370f00c29055cdeb8421467a74a3477b 100644
--- a/chrome/browser/extensions/event_router_forwarder_unittest.cc
+++ b/chrome/browser/extensions/event_router_forwarder_unittest.cc
@@ -110,16 +110,6 @@ class EventRouterForwarderTest : public testing::Test {
profile2_ = profile_manager_.CreateTestingProfile("two");
}
- TestingProfile* CreateIncognitoProfile(TestingProfile* base) {
- TestingProfile::Builder builder;
- builder.SetIncognito();
- scoped_ptr<TestingProfile> incognito = builder.Build();
- TestingProfile* incognito_ptr = incognito.get();
- // Incognito profile now owned by |base|
- base->SetOffTheRecordProfile(incognito.PassAs<Profile>());
- return incognito_ptr;
- }
-
base::MessageLoopForUI message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread io_thread_;
@@ -146,7 +136,7 @@ TEST_F(EventRouterForwarderTest, BroadcastRendererUIIncognito) {
new MockEventRouterForwarder);
using ::testing::_;
GURL url;
- Profile* incognito = CreateIncognitoProfile(profile1_);
+ Profile* incognito = profile1_->GetOffTheRecordProfile();
EXPECT_CALL(*event_router.get(),
CallEventRouter(profile1_, "", kEventName, profile1_, url));
EXPECT_CALL(*event_router.get(), CallEventRouter(incognito, _, _, _, _))
@@ -196,7 +186,7 @@ TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) {
TEST_F(EventRouterForwarderTest, UnicastRendererUIRestrictedIncognito1) {
scoped_refptr<MockEventRouterForwarder> event_router(
new MockEventRouterForwarder);
- Profile* incognito = CreateIncognitoProfile(profile1_);
+ Profile* incognito = profile1_->GetOffTheRecordProfile();
using ::testing::_;
GURL url;
EXPECT_CALL(*event_router.get(),
@@ -212,7 +202,7 @@ TEST_F(EventRouterForwarderTest, UnicastRendererUIRestrictedIncognito1) {
TEST_F(EventRouterForwarderTest, UnicastRendererUIRestrictedIncognito2) {
scoped_refptr<MockEventRouterForwarder> event_router(
new MockEventRouterForwarder);
- Profile* incognito = CreateIncognitoProfile(profile1_);
+ Profile* incognito = profile1_->GetOffTheRecordProfile();
using ::testing::_;
GURL url;
EXPECT_CALL(*event_router.get(), CallEventRouter(profile1_, _, _, _, _))
@@ -241,7 +231,7 @@ TEST_F(EventRouterForwarderTest, UnicastRendererUIUnrestricted) {
TEST_F(EventRouterForwarderTest, UnicastRendererUIUnrestrictedIncognito) {
scoped_refptr<MockEventRouterForwarder> event_router(
new MockEventRouterForwarder);
- Profile* incognito = CreateIncognitoProfile(profile1_);
+ Profile* incognito = profile1_->GetOffTheRecordProfile();
using ::testing::_;
GURL url;
EXPECT_CALL(*event_router.get(),
« no previous file with comments | « chrome/browser/extensions/api/cookies/cookies_unittest.cc ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698