- Revision
- 253927
- Author
- [email protected]
- Date
- 2019-12-28 13:42:32 -0800 (Sat, 28 Dec 2019)
Log Message
Allow disabling internal and experimental features in run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=205614
Reviewed by Tim Horton.
Add an optional true/false parameter to --internal-feature/--experimental-feature options.
This can be useful for isolating problems in features that are enabled by default. Example:
--internal-feature LayoutFormattingContextIntegrationEnabled=false
The [=true|false] syntax is the same as used in test headers.
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* WebKitTestRunner/Options.cpp:
(WTR::parseFeature):
(WTR::handleOptionExperimentalFeature):
(WTR::handleOptionInternalFeature):
* WebKitTestRunner/Options.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::testOptionsForTest const):
* WebKitTestRunner/TestController.h:
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (253926 => 253927)
--- trunk/Tools/ChangeLog 2019-12-28 20:16:36 UTC (rev 253926)
+++ trunk/Tools/ChangeLog 2019-12-28 21:42:32 UTC (rev 253927)
@@ -1,3 +1,28 @@
+2019-12-28 Antti Koivisto <[email protected]>
+
+ Allow disabling internal and experimental features in run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=205614
+
+ Reviewed by Tim Horton.
+
+ Add an optional true/false parameter to --internal-feature/--experimental-feature options.
+ This can be useful for isolating problems in features that are enabled by default. Example:
+
+ --internal-feature LayoutFormattingContextIntegrationEnabled=false
+
+ The [=true|false] syntax is the same as used in test headers.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ (parse_args):
+ * WebKitTestRunner/Options.cpp:
+ (WTR::parseFeature):
+ (WTR::handleOptionExperimentalFeature):
+ (WTR::handleOptionInternalFeature):
+ * WebKitTestRunner/Options.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::testOptionsForTest const):
+ * WebKitTestRunner/TestController.h:
+
2019-12-25 Dean Jackson <[email protected]>
WKTR/DRT always trigger the Discrete GPU on dual GPU systems
Modified: trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py (253926 => 253927)
--- trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2019-12-28 20:16:36 UTC (rev 253926)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py 2019-12-28 21:42:32 UTC (rev 253927)
@@ -118,10 +118,10 @@
help="Use accelerated drawing (OS X only)"),
optparse.make_option("--remote-layer-tree", action="" default=False,
help="Use the remote layer tree drawing model (OS X WebKit2 only)"),
- optparse.make_option("--internal-feature", type="string", action=""
- default=[], help="Enable internal feature"),
- optparse.make_option("--experimental-feature", type="string", action=""
- default=[], help="Enable experimental feature"),
+ optparse.make_option("--internal-feature", type="string", action="" default=[],
+ help="Enable (disable) an internal feature (--internal-feature FeatureName[=true|false])"),
+ optparse.make_option("--experimental-feature", type="string", action="" default=[],
+ help="Enable (disable) an experimental feature (--experimental-feature FeatureName[=true|false])"),
]))
option_group_definitions.append(("WebKit Options", [
Modified: trunk/Tools/WebKitTestRunner/Options.cpp (253926 => 253927)
--- trunk/Tools/WebKitTestRunner/Options.cpp 2019-12-28 20:16:36 UTC (rev 253926)
+++ trunk/Tools/WebKitTestRunner/Options.cpp 2019-12-28 21:42:32 UTC (rev 253927)
@@ -105,16 +105,27 @@
return true;
}
-static bool handleOptionExperimentalFeature(Options& options, const char*, const char* feature)
+static bool parseFeature(String featureString, HashMap<String, bool>& features)
{
- options.experimentalFeatures.insert(feature);
+ auto strings = featureString.split('=');
+ if (strings.isEmpty() || strings.size() > 2)
+ return false;
+
+ auto featureName = strings[0];
+ bool enabled = strings.size() == 1 || strings[1] == "true";
+
+ features.set(featureName, enabled);
return true;
}
+static bool handleOptionExperimentalFeature(Options& options, const char*, const char* feature)
+{
+ return parseFeature(feature, options.experimentalFeatures);
+}
+
static bool handleOptionInternalFeature(Options& options, const char*, const char* feature)
{
- options.internalFeatures.insert(feature);
- return true;
+ return parseFeature(feature, options.internalFeatures);
}
static bool handleOptionUnmatched(Options& options, const char* option, const char*)
Modified: trunk/Tools/WebKitTestRunner/Options.h (253926 => 253927)
--- trunk/Tools/WebKitTestRunner/Options.h 2019-12-28 20:16:36 UTC (rev 253926)
+++ trunk/Tools/WebKitTestRunner/Options.h 2019-12-28 21:42:32 UTC (rev 253927)
@@ -32,7 +32,10 @@
#include <stdio.h>
#include <string>
#include <vector>
+#include <wtf/HashMap.h>
#include <wtf/Vector.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
namespace WTR {
@@ -51,8 +54,8 @@
bool allowAnyHTTPSCertificateForAllowedHosts { false };
std::vector<std::string> paths;
std::set<std::string> allowedHosts;
- std::set<std::string> internalFeatures;
- std::set<std::string> experimentalFeatures;
+ HashMap<String, bool> internalFeatures;
+ HashMap<String, bool> experimentalFeatures;
};
class Option {
Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (253926 => 253927)
--- trunk/Tools/WebKitTestRunner/TestController.cpp 2019-12-28 20:16:36 UTC (rev 253926)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2019-12-28 21:42:32 UTC (rev 253927)
@@ -1473,9 +1473,9 @@
options.shouldShowWebView = m_shouldShowWebView;
for (auto& feature : m_internalFeatures)
- options.internalDebugFeatures.add(feature.c_str(), true);
+ options.internalDebugFeatures.add(feature.key, feature.value);
for (auto& feature : m_experimentalFeatures)
- options.experimentalFeatures.add(feature.c_str(), true);
+ options.experimentalFeatures.add(feature.key, feature.value);
updatePlatformSpecificTestOptionsForTest(options, command.pathOrURL);
updateTestOptionsFromTestHeader(options, command.pathOrURL, command.absolutePath);
Modified: trunk/Tools/WebKitTestRunner/TestController.h (253926 => 253927)
--- trunk/Tools/WebKitTestRunner/TestController.h 2019-12-28 20:16:36 UTC (rev 253926)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2019-12-28 21:42:32 UTC (rev 253927)
@@ -509,8 +509,8 @@
bool m_createdOtherPage { false };
std::vector<std::string> m_paths;
std::set<std::string> m_allowedHosts;
- std::set<std::string> m_internalFeatures;
- std::set<std::string> m_experimentalFeatures;
+ HashMap<String, bool> m_internalFeatures;
+ HashMap<String, bool> m_experimentalFeatures;
WKRetainPtr<WKStringRef> m_injectedBundlePath;
WKRetainPtr<WKStringRef> m_testPluginDirectory;