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

Unified Diff: content/test/test_blink_web_unit_test_support.cc

Issue 1848523002: Changes to support using base/feature_list.h from gin/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gin/isolate_holder.cc changes (sample feature) reverted. Created 4 years, 9 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: content/test/test_blink_web_unit_test_support.cc
diff --git a/content/test/test_blink_web_unit_test_support.cc b/content/test/test_blink_web_unit_test_support.cc
index d4a55d1d77a1d3535c4929166d64ff6006eceaf9..83f1a28531be1616e66772f42763ffe458949324 100644
--- a/content/test/test_blink_web_unit_test_support.cc
+++ b/content/test/test_blink_web_unit_test_support.cc
@@ -4,6 +4,7 @@
#include "content/test/test_blink_web_unit_test_support.h"
+#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
@@ -117,6 +118,10 @@ TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
scheduler::LazySchedulerMessageLoopDelegateForTests::Create()));
web_thread_ = renderer_scheduler_->CreateMainThread();
+ // Set up a FeatureList instance, so that code using that API will not hit a
+ // an error that it's not set. Cleared by ClearInstanceForTesting() below.
+ base::FeatureList::SetInstance(make_scoped_ptr(new base::FeatureList));
+
blink::initialize(this);
blink::setLayoutTestMode(true);
blink::WebRuntimeFeatures::enableApplicationCache(true);
@@ -156,6 +161,9 @@ TestBlinkWebUnitTestSupport::~TestBlinkWebUnitTestSupport() {
if (renderer_scheduler_)
renderer_scheduler_->Shutdown();
blink::shutdown();
+
+ // Clear the FeatureList that was registered in the constructor.
+ base::FeatureList::ClearInstanceForTesting();
}
blink::WebBlobRegistry* TestBlinkWebUnitTestSupport::blobRegistry() {

Powered by Google App Engine
This is Rietveld 408576698