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

Unified Diff: content/test/test_blink_web_unit_test_support.cc

Issue 1835553002: Control ES2015 'Tail call elimination' language feature via finch flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed redness by moving FeatureList initialization in tests up the call stack. 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 3e7b27ce41548b08739c302e6be59df489851ba7..58cfe76e885e05274c5143d8cb3b25133caa9806 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"
@@ -99,6 +100,9 @@ TestBlinkWebUnitTestSupport::TestBlinkWebUnitTestSupport() {
gin::V8Initializer::LoadV8Snapshot();
gin::V8Initializer::LoadV8Natives();
#endif
+ // Set up a FeatureList instance, so that code using that API will not hit
+ // an error that it's not set. Cleared by ClearInstanceForTesting() below.
+ base::FeatureList::SetInstance(make_scoped_ptr(new base::FeatureList));
scoped_refptr<base::SingleThreadTaskRunner> dummy_task_runner;
scoped_ptr<base::ThreadTaskRunnerHandle> dummy_task_runner_handle;
@@ -157,6 +161,9 @@ TestBlinkWebUnitTestSupport::~TestBlinkWebUnitTestSupport() {
if (renderer_scheduler_)
renderer_scheduler_->Shutdown();
blink::shutdown();
+
+ // Clear the FeatureList that was registered above.
+ base::FeatureList::ClearInstanceForTesting();
}
blink::WebBlobRegistry* TestBlinkWebUnitTestSupport::blobRegistry() {
« base/test/test_suite.cc ('K') | « base/test/test_suite.cc ('k') | gin/isolate_holder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698