Commit b242320c authored by Devlin's avatar Devlin Committed by Commit Bot

Revert "Return empty startup tabs for incognito profile."

This reverts commit 3d657e12.

Reason for revert: New unittest fails:

[ RUN      ] StartupTabProviderTest.IncognitoProfile
../../chrome/browser/ui/startup/startup_tab_provider_unittest.cc(453): error: Value of: StartupTabProviderImpl().GetOnboardingTabs(incognito).empty()
  Actual: false
Expected: true
[  FAILED  ] StartupTabProviderTest.IncognitoProfile (16 ms)

https://build.chromium.org/p/chromium.win/builders/Win10%20Tests%20x64/builds/16448

Original change's description:
> Return empty startup tabs for incognito profile.
> 
> StartupTabProvider may be called when Chrome starts in an incognito profile,
> which leads to a crash at start-up. This CL addresses this and adds a unit
> test to make sure it does not regress in the future.
> 
> Bug: 769241
> Change-Id: Idea489bc05e31d7ac693cb935b1481979099bd09
> Reviewed-on: https://chromium-review.googlesource.com/689535
> Reviewed-by: Scott Violet <sky@chromium.org>
> Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#505395}

TBR=sky@chromium.org,msarda@chromium.org

Change-Id: I70ea9825d6dab8084292b40fa2d36d65488ff2e7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 769241
Reviewed-on: https://chromium-review.googlesource.com/692566Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505440}
parent 384db9aa
...@@ -71,10 +71,8 @@ StartupTabs StartupTabProviderImpl::GetOnboardingTabs(Profile* profile) const { ...@@ -71,10 +71,8 @@ StartupTabs StartupTabProviderImpl::GetOnboardingTabs(Profile* profile) const {
prefs && prefs->GetBoolean(prefs::kHasSeenWelcomePage); prefs && prefs->GetBoolean(prefs::kHasSeenWelcomePage);
standard_params.is_signin_allowed = profile->IsSyncAllowed(); standard_params.is_signin_allowed = profile->IsSyncAllowed();
SigninManager* signin_manager = SigninManagerFactory::GetForProfile(profile); SigninManager* signin_manager = SigninManagerFactory::GetForProfile(profile);
standard_params.is_signed_in = standard_params.is_signed_in = signin_manager->IsAuthenticated();
signin_manager && signin_manager->IsAuthenticated(); standard_params.is_signin_in_progress = signin_manager->AuthInProgress();
standard_params.is_signin_in_progress =
signin_manager && signin_manager->AuthInProgress();
standard_params.is_supervised_user = profile->IsSupervised(); standard_params.is_supervised_user = profile->IsSupervised();
#if defined(OS_WIN) #if defined(OS_WIN)
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/test/test_browser_thread_bundle.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h" #include "url/gurl.h"
...@@ -445,10 +443,3 @@ TEST(StartupTabProviderTest, GetNewTabPageTabsForState_Negative) { ...@@ -445,10 +443,3 @@ TEST(StartupTabProviderTest, GetNewTabPageTabsForState_Negative) {
ASSERT_TRUE(output.empty()); ASSERT_TRUE(output.empty());
} }
TEST(StartupTabProviderTest, IncognitoProfile) {
content::TestBrowserThreadBundle thread_bundle;
TestingProfile profile;
Profile* incognito = profile.GetOffTheRecordProfile();
EXPECT_TRUE(StartupTabProviderImpl().GetOnboardingTabs(incognito).empty());
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment