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

Unified Diff: content/child/resource_dispatcher_unittest.cc

Issue 2484613002: Migrate more tests to ScopedFeatureList. (Closed)
Patch Set: fix weakptrfactory must be last member error 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/child/resource_dispatcher_unittest.cc
diff --git a/content/child/resource_dispatcher_unittest.cc b/content/child/resource_dispatcher_unittest.cc
index 2797fb4ae71a88c113ae9b14d2efa7d48a329fcb..d6d56490495b983ecc045fc32c87d01fd1640049 100644
--- a/content/child/resource_dispatcher_unittest.cc
+++ b/content/child/resource_dispatcher_unittest.cc
@@ -13,13 +13,13 @@
#include <utility>
#include <vector>
-#include "base/feature_list.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/shared_memory.h"
#include "base/message_loop/message_loop.h"
#include "base/process/process_handle.h"
#include "base/run_loop.h"
+#include "base/test/scoped_feature_list.h"
#include "content/child/request_extra_data.h"
#include "content/common/appcache_interfaces.h"
#include "content/common/resource_messages.h"
@@ -379,11 +379,10 @@ TEST_F(ResourceDispatcherTest, RoundTrip) {
// A simple request with an inline data response.
TEST_F(ResourceDispatcherTest, ResponseWithInlinedData) {
- auto feature_list = base::MakeUnique<base::FeatureList>();
- feature_list->InitializeFromCommandLine(
- features::kOptimizeLoadingIPCForSmallResources.name, std::string());
- base::FeatureList::ClearInstanceForTesting();
- base::FeatureList::SetInstance(std::move(feature_list));
+ base::test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.InitAndEnableFeature(
+ features::kOptimizeLoadingIPCForSmallResources);
+
std::unique_ptr<ResourceRequest> request(CreateResourceRequest(false));
TestRequestPeer::Context peer_context;
StartAsync(std::move(request), NULL, &peer_context);

Powered by Google App Engine
This is Rietveld 408576698