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

Unified Diff: chrome/browser/ui/search/local_ntp_browsertest.cc

Issue 2910843002: [Cleanup] Move all browsertests to use ScopedFeatureList to modify features
Patch Set: rebase update Created 3 years, 6 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/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 806ee10e01e97c43f154bc1f2a3b3d59a98ed71a..1d5215dd0b8b254e223b7ab6c57235cbbed333fd 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"
@@ -269,7 +271,7 @@ class LocalNTPSmokeTest : public InProcessBrowserTest {
protected:
void SetUpCommandLine(base::CommandLine* cmdline) override {
- cmdline->AppendSwitchASCII(switches::kEnableFeatures, "UseGoogleLocalNtp");
+ scoped_feature_list_.InitAndEnableFeature(features::kUseGoogleLocalNtp);
}
void SetUserSelectedDefaultSearchProvider(const std::string& base_url) {
@@ -285,6 +287,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) {
@@ -376,8 +381,12 @@ class LocalNTPOneGoogleBarSmokeTest : public InProcessBrowserTest {
protected:
void SetUpCommandLine(base::CommandLine* cmdline) override {
- cmdline->AppendSwitchASCII(switches::kEnableFeatures,
- "UseGoogleLocalNtp,OneGoogleBarOnLocalNtp");
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+ scoped_feature_list_.InitWithFeatures(
+ {features::kUseGoogleLocalNtp, features::kOneGoogleBarOnLocalNtp}, {});
+#else
+ scoped_feature_list_.InitAndEnableFeature(features::kUseGoogleLocalNtp);
+#endif
}
void SetUpInProcessBrowserTestFixture() override {
@@ -414,6 +423,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,

Powered by Google App Engine
This is Rietveld 408576698