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

Unified Diff: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc

Issue 556173002: Ensure incognito TestingProfiles are incognito for their whole lifetime. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: respond to comments Created 6 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
Index: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
index 13bfd6573afdcd7c1d12bff23aa92c9c7c91ddd0..d9ee9b17679d76d1a31316172983e27bcc5b1d00 100644
--- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
+++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc
@@ -392,10 +392,12 @@ class OneClickSigninHelperIncognitoTest : public OneClickSigninHelperTest {
content::BrowserContext*
OneClickSigninHelperIncognitoTest::CreateBrowserContext() {
- // Builds an incognito profile to run this test.
- TestingProfile::Builder builder;
- builder.SetIncognito();
- return builder.Build().release();
+ // Simulate an incognito profile to run this test. RenderViewHostTestHarness
+ // takes ownership of the return value, so it can't be a "proper" incognito
+ // profile, since they are owned by their parent, non-incognito profile.
+ scoped_ptr<TestingProfile> profile = TestingProfile::Builder().Build();
+ profile->ForceIncognito(true);
+ return profile.release();
}
TEST_F(OneClickSigninHelperTest, CanOfferNoContents) {

Powered by Google App Engine
This is Rietveld 408576698