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 a3b0bf6b00a277493713fbe22c2a6abbe4a3593f..3461bd257b94c39e4a20318ce554e7c2494035c6 100644 |
--- a/chrome/browser/ui/search/local_ntp_browsertest.cc |
+++ b/chrome/browser/ui/search/local_ntp_browsertest.cc |
@@ -11,7 +11,9 @@ |
#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 "build/build_config.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/search/one_google_bar/one_google_bar_data.h" |
@@ -26,6 +28,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" |
@@ -265,13 +268,11 @@ IN_PROC_BROWSER_TEST_F(LocalNTPTest, |
// wrangling. It just turns on the local NTP. |
class LocalNTPSmokeTest : public InProcessBrowserTest { |
public: |
- LocalNTPSmokeTest() {} |
- |
- protected: |
- void SetUpCommandLine(base::CommandLine* cmdline) override { |
- cmdline->AppendSwitchASCII(switches::kEnableFeatures, "UseGoogleLocalNtp"); |
+ LocalNTPSmokeTest() { |
+ scoped_feature_list_.InitAndEnableFeature(features::kUseGoogleLocalNtp); |
} |
+ protected: |
void SetUserSelectedDefaultSearchProvider(const std::string& base_url) { |
base::ThreadRestrictions::ScopedAllowIO allow_io; |
TemplateURLData data; |
@@ -285,6 +286,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) { |
@@ -372,14 +376,16 @@ class FakeOneGoogleBarFetcher : public OneGoogleBarFetcher { |
class LocalNTPOneGoogleBarSmokeTest : public InProcessBrowserTest { |
public: |
- LocalNTPOneGoogleBarSmokeTest() {} |
- |
- protected: |
- void SetUpCommandLine(base::CommandLine* cmdline) override { |
- cmdline->AppendSwitchASCII(switches::kEnableFeatures, |
- "UseGoogleLocalNtp,OneGoogleBarOnLocalNtp"); |
+ LocalNTPOneGoogleBarSmokeTest() { |
+#if !defined(OS_ANDROID) && !defined(OS_IOS) |
+ scoped_feature_list_.InitWithFeatures( |
+ {features::kUseGoogleLocalNtp, features::kOneGoogleBarOnLocalNtp}, {}); |
+#else |
+ scoped_feature_list_.InitAndEnableFeature(features::kUseGoogleLocalNtp); |
+#endif |
} |
+ protected: |
void SetUpInProcessBrowserTestFixture() override { |
will_create_browser_context_services_subscription_ = |
BrowserContextDependencyManager::GetInstance() |
@@ -412,6 +418,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, |