| Index: chrome/browser/ui/search/local_ntp_browsertest.cc
|
| diff --git a/chrome/browser/ui/search/local_ntp_browsertest.cc b/chrome/browser/ui/search/local_ntp_browsertest.cc
|
| index bb2db92ca47121b1b4965170123657e13f028dff..2c6f05bad32a1a0897620707e4d4eb25215044e0 100644
|
| --- a/chrome/browser/ui/search/local_ntp_browsertest.cc
|
| +++ b/chrome/browser/ui/search/local_ntp_browsertest.cc
|
| @@ -11,6 +11,7 @@
|
| #include "base/memory/ptr_util.h"
|
| #include "base/optional.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| +#include "base/test/scoped_feature_list.h"
|
| #include "base/threading/thread_restrictions.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| @@ -26,6 +27,7 @@
|
| #include "chrome/browser/ui/search/instant_test_base.h"
|
| #include "chrome/browser/ui/search/instant_test_utils.h"
|
| #include "chrome/browser/ui/tabs/tab_strip_model.h"
|
| +#include "chrome/common/chrome_features.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "chrome/test/base/in_process_browser_test.h"
|
| @@ -268,8 +270,9 @@ class LocalNTPSmokeTest : public InProcessBrowserTest {
|
| LocalNTPSmokeTest() {}
|
|
|
| protected:
|
| - void SetUpCommandLine(base::CommandLine* cmdline) override {
|
| - cmdline->AppendSwitchASCII(switches::kEnableFeatures, "UseGoogleLocalNtp");
|
| + void SetUp() override {
|
| + scoped_feature_list_.InitAndEnableFeature(features::kUseGoogleLocalNtp);
|
| + InProcessBrowserTest::SetUp();
|
| }
|
|
|
| void SetUserSelectedDefaultSearchProvider(const std::string& base_url) {
|
| @@ -285,6 +288,9 @@ class LocalNTPSmokeTest : public InProcessBrowserTest {
|
| template_url_service->Add(base::MakeUnique<TemplateURL>(data));
|
| template_url_service->SetUserSelectedDefaultSearchProvider(template_url);
|
| }
|
| +
|
| + private:
|
| + base::test::ScopedFeatureList scoped_feature_list_;
|
| };
|
|
|
| IN_PROC_BROWSER_TEST_F(LocalNTPSmokeTest, GoogleNTPLoadsWithoutError) {
|
| @@ -375,9 +381,14 @@ class LocalNTPOneGoogleBarSmokeTest : public InProcessBrowserTest {
|
| LocalNTPOneGoogleBarSmokeTest() {}
|
|
|
| protected:
|
| - void SetUpCommandLine(base::CommandLine* cmdline) override {
|
| - cmdline->AppendSwitchASCII(switches::kEnableFeatures,
|
| - "UseGoogleLocalNtp,OneGoogleBarOnLocalNtp");
|
| + void SetUp() override {
|
| +#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
| + scoped_feature_list_.InitWithFeatures(
|
| + {features::kUseGoogleLocalNtp, features::kOneGoogleBarOnLocalNtp}, {});
|
| +#else
|
| + scoped_feature_list_.InitAndEnableFeature(features::kUseGoogleLocalNtp);
|
| +#endif
|
| + InProcessBrowserTest::SetUp();
|
| }
|
|
|
| void SetUpInProcessBrowserTestFixture() override {
|
| @@ -414,6 +425,7 @@ class LocalNTPOneGoogleBarSmokeTest : public InProcessBrowserTest {
|
| std::unique_ptr<
|
| base::CallbackList<void(content::BrowserContext*)>::Subscription>
|
| will_create_browser_context_services_subscription_;
|
| + base::test::ScopedFeatureList scoped_feature_list_;
|
| };
|
|
|
| IN_PROC_BROWSER_TEST_F(LocalNTPOneGoogleBarSmokeTest,
|
|
|