TestRunner should always enable all the experimental features
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 22:28:40 +0000 (22:28 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 22:28:40 +0000 (22:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157360
<rdar://problem/26099748>

Reviewed by Anders Carlsson.

Source/WebKit2:

Experimental features are disabled by default, but it is
a pain to enable them in every test. Instead, have the
test runner turn them all on.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesEnableAllExperimentalFeatures):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::enableAllExperimentalFeatures):
* UIProcess/WebPreferences.h:

Tools:

Call the new SPI that enables all the experimental features.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200436 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h
Source/WebKit2/UIProcess/WebPreferences.cpp
Source/WebKit2/UIProcess/WebPreferences.h
Tools/ChangeLog
Tools/WebKitTestRunner/TestController.cpp

index e86558d..f07aee2 100644 (file)
@@ -1,3 +1,22 @@
+2016-05-04  Dean Jackson  <dino@apple.com>
+
+        TestRunner should always enable all the experimental features
+        https://bugs.webkit.org/show_bug.cgi?id=157360
+        <rdar://problem/26099748>
+
+        Reviewed by Anders Carlsson.
+
+        Experimental features are disabled by default, but it is
+        a pain to enable them in every test. Instead, have the
+        test runner turn them all on.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesEnableAllExperimentalFeatures):
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/WebPreferences.cpp:
+        (WebKit::WebPreferences::enableAllExperimentalFeatures):
+        * UIProcess/WebPreferences.h:
+
 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
 
         Add WKPreference for SelectionPaintingWithoutSelectionGaps
index 61431ea..3ce8618 100644 (file)
@@ -62,6 +62,11 @@ WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef preferencesRef)
     return toAPI(preferences.release().leakRef());
 }
 
+void WKPreferencesEnableAllExperimentalFeatures(WKPreferencesRef preferencesRef)
+{
+    toImpl(preferencesRef)->enableAllExperimentalFeatures();
+}
+
 void WKPreferencesSetJavaScriptEnabled(WKPreferencesRef preferencesRef, bool javaScriptEnabled)
 {
     toImpl(preferencesRef)->setJavaScriptEnabled(javaScriptEnabled);
index 7d454a8..23bed99 100644 (file)
@@ -57,6 +57,8 @@ typedef unsigned WKJavaScriptRuntimeFlagSet;
 // Creates a copy with no identifier.
 WK_EXPORT WKPreferencesRef WKPreferencesCreateCopy(WKPreferencesRef);
 
+WK_EXPORT void WKPreferencesEnableAllExperimentalFeatures(WKPreferencesRef);
+
 // Defaults to kWKFontSmoothingLevelMedium.
 WK_EXPORT void WKPreferencesSetFontSmoothingLevel(WKPreferencesRef, WKFontSmoothingLevel);
 WK_EXPORT WKFontSmoothingLevel WKPreferencesGetFontSmoothingLevel(WKPreferencesRef);
index 2c8495b..1f175d1 100644 (file)
@@ -263,6 +263,16 @@ void WebPreferences::setEnabledForFeature(bool value, const API::ExperimentalFea
     }
 }
 
+void WebPreferences::enableAllExperimentalFeatures()
+{
+#define SET_FEATURE_ENABLED(KeyUpper, KeyLower, TypeName, Type, DefaultValue, HumanReadableName, HumanReadableDescription) \
+    set##KeyUpper(true); \
+
+    FOR_EACH_WEBKIT_EXPERIMENTAL_FEATURE_PREFERENCE(SET_FEATURE_ENABLED)
+
+#undef SET_FEATURE_ENABLED
+}
+
 bool WebPreferences::anyPagesAreUsingPrivateBrowsing()
 {
     return privateBrowsingPageCount;
index 26599b3..d47447c 100644 (file)
@@ -67,6 +67,7 @@ public:
     static const Vector<RefPtr<API::Object>>& experimentalFeatures();
     bool isEnabledForFeature(const API::ExperimentalFeature&) const;
     void setEnabledForFeature(bool, const API::ExperimentalFeature&);
+    void enableAllExperimentalFeatures();
 
     // Exposed for WebKitTestRunner use only.
     void forceUpdate() { update(); }
index 41f3b8a..44e7d3f 100644 (file)
@@ -1,3 +1,16 @@
+2016-05-04  Dean Jackson  <dino@apple.com>
+
+        TestRunner should always enable all the experimental features
+        https://bugs.webkit.org/show_bug.cgi?id=157360
+        <rdar://problem/26099748>
+
+        Reviewed by Anders Carlsson.
+
+        Call the new SPI that enables all the experimental features.
+
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2016-05-04  Mark Lam  <mark.lam@apple.com>
 
         ES6 Function.name inferred from property names of literal objects can break some websites.
index 96e16fe..5d59bcf 100644 (file)
@@ -643,6 +643,7 @@ void TestController::resetPreferencesToConsistentValues(const TestOptions& optio
     // Reset preferences
     WKPreferencesRef preferences = platformPreferences();
     WKPreferencesResetTestRunnerOverrides(preferences);
+    WKPreferencesEnableAllExperimentalFeatures(preferences);
     WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled(preferences, false);
     WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
     WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing);