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

Unified Diff: chrome/browser/android/offline_pages/offline_page_utils_unittest.cc

Issue 2484613002: Migrate more tests to ScopedFeatureList. (Closed)
Patch Set: rebase Created 4 years, 1 month 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
« no previous file with comments | « base/feature_list.h ('k') | chrome/browser/browser_about_handler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
diff --git a/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc b/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
index 01d17afcb231c5555d094ac1c42bf2c9d8a0a188..092b3b5b3a03e51f1c5d68d441af8dd8e98d0c86 100644
--- a/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
+++ b/chrome/browser/android/offline_pages/offline_page_utils_unittest.cc
@@ -9,12 +9,12 @@
#include "base/callback.h"
#include "base/command_line.h"
-#include "base/feature_list.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/run_loop.h"
#include "base/strings/string16.h"
+#include "base/test/scoped_feature_list.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
#include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h"
@@ -84,6 +84,7 @@ class OfflinePageUtilsTest
int64_t offline_id_;
GURL url_;
TestingProfile profile_;
+ base::test::ScopedFeatureList scoped_feature_list_;
};
OfflinePageUtilsTest::OfflinePageUtilsTest() = default;
@@ -93,11 +94,8 @@ OfflinePageUtilsTest::~OfflinePageUtilsTest() {}
void OfflinePageUtilsTest::SetUp() {
// Enables offline pages feature.
// TODO(jianli): Remove this once the feature is completely enabled.
- base::FeatureList::ClearInstanceForTesting();
- std::unique_ptr<base::FeatureList> feature_list(new base::FeatureList);
- feature_list->InitializeFromCommandLine(
- offline_pages::kOfflineBookmarksFeature.name, "");
- base::FeatureList::SetInstance(std::move(feature_list));
+ scoped_feature_list_.InitAndEnableFeature(
+ offline_pages::kOfflineBookmarksFeature);
// Set up the factory for testing.
OfflinePageModelFactory::GetInstance()->SetTestingFactoryAndUse(
« no previous file with comments | « base/feature_list.h ('k') | chrome/browser/browser_about_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698