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

Unified Diff: content/browser/loader/async_resource_handler_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
Index: content/browser/loader/async_resource_handler_unittest.cc
diff --git a/content/browser/loader/async_resource_handler_unittest.cc b/content/browser/loader/async_resource_handler_unittest.cc
index d1c59e05341c87db0f4d0dfaebfa359373a85865..b86d2957c40a8142331374fcb07bcf2a210137c3 100644
--- a/content/browser/loader/async_resource_handler_unittest.cc
+++ b/content/browser/loader/async_resource_handler_unittest.cc
@@ -14,7 +14,6 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
-#include "base/feature_list.h"
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
@@ -23,6 +22,7 @@
#include "base/process/process.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
+#include "base/test/scoped_feature_list.h"
#include "content/browser/loader/resource_dispatcher_host_impl.h"
#include "content/browser/loader/resource_loader.h"
#include "content/browser/loader/resource_loader_delegate.h"
@@ -262,11 +262,9 @@ TEST_F(AsyncResourceHandlerTest, OneChunkLengths) {
TEST_F(AsyncResourceHandlerTest, InlinedChunkLengths) {
// TODO(ricea): Remove this Feature-enabling code once the feature is on by
// default.
- auto feature_list = base::MakeUnique<base::FeatureList>();
- feature_list->InitializeFromCommandLine(
- features::kOptimizeLoadingIPCForSmallResources.name, "");
- base::FeatureList::ClearInstanceForTesting();
- base::FeatureList::SetInstance(std::move(feature_list));
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ features::kOptimizeLoadingIPCForSmallResources);
// Smaller than kInlinedLeadingChunkSize.
StartRequestAndWaitWithResponseDataSize(8);

Powered by Google App Engine
This is Rietveld 408576698