Commit 83e1e19f authored by Christian Biesinger's avatar Christian Biesinger Committed by Commit Bot

Make webkit_unit_tests support --enable-blink-features

(Also --disable-blink-features)

We would like to use this to run the tests with LayoutNG enabled.

Change-Id: I1c8909dc3e1aaa57dc6745624ba6f8170ccde7e5
Reviewed-on: https://chromium-review.googlesource.com/c/1329884Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Christian Biesinger <cbiesinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607129}
parent 29ae040c
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/test/scoped_task_environment.h" #include "base/test/scoped_task_environment.h"
#include "base/test/test_discardable_memory_allocator.h" #include "base/test/test_discardable_memory_allocator.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/common/content_switches_internal.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/user_agent.h" #include "content/public/common/user_agent.h"
#include "content/public/test/test_content_client_initializer.h" #include "content/public/test/test_content_client_initializer.h"
...@@ -70,6 +71,17 @@ void SetUpBlinkTestEnvironment() { ...@@ -70,6 +71,17 @@ void SetUpBlinkTestEnvironment() {
blink::WebRuntimeFeatures::EnableExperimentalFeatures(true); blink::WebRuntimeFeatures::EnableExperimentalFeatures(true);
blink::WebRuntimeFeatures::EnableTestOnlyFeatures(true); blink::WebRuntimeFeatures::EnableTestOnlyFeatures(true);
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
for (const std::string& feature : content::FeaturesFromSwitch(
command_line, switches::kEnableBlinkFeatures)) {
blink::WebRuntimeFeatures::EnableFeatureFromString(feature, true);
}
for (const std::string& feature : content::FeaturesFromSwitch(
command_line, switches::kDisableBlinkFeatures)) {
blink::WebRuntimeFeatures::EnableFeatureFromString(feature, false);
}
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
mock_cr_app::RegisterMockCrApp(); mock_cr_app::RegisterMockCrApp();
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment