Use window.internals instead of overridePreference to set WebCore settings in tests
authorfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 18:48:01 +0000 (18:48 +0000)
committerfred.wang@free.fr <fred.wang@free.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jun 2017 18:48:01 +0000 (18:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173714

Patch by Frederic Wang <fwang@igalia.com> on 2017-06-23
Reviewed by Simon Fraser.

Source/WebKit2:

This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that
are no longer necessary after the changes done in LayoutTests.

* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences
that no longer require testRunner.overridePreference calls in tests.

LayoutTests:

This commit is a first step to replace the use of testRunner.overridePreference with
internals.settings.set* calls in tests. Such a call will fail immediately and obviously if
its a function that does not exist, and these settings are restored properly between tests.
Some preferences that do not have a WebCore setting or an internals.settings setter are not
handled yet. The temporary failure added in r218480 for fast/frames/flattening/set-preference
is removed and so is a custom expectation caret-mode-document-begin-end for Mac WK1.

* accessibility/gtk/caret-browsing-select-focus.html: Use internals.settings.set* function.
* accessibility/gtk/caret-browsing-text-focus.html: Ditto.
* accessibility/gtk/caret-offsets-and-extraneous-white-spaces.html: Ditto.
* accessibility/gtk/caret-offsets.html: Ditto.
* accessibility/gtk/text-in-span-block-in-a-block.html: Ditto.
* css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html: Ditto.
* css3/blending/blend-mode-simple.html: Ditto.
* css3/blending/effect-background-blend-mode.html: Ditto.
* css3/filters/blur-filter-page-scroll-parents.html: Ditto.
* css3/filters/blur-filter-page-scroll-self.html: Ditto.
* css3/filters/blur-filter-page-scroll.html: Ditto.
* css3/filters/effect-blur.html: Ditto.
* css3/filters/effect-brightness-clamping.html: Ditto.
* css3/filters/effect-brightness.html: Ditto.
* css3/filters/effect-combined.html: Ditto.
* css3/filters/effect-contrast.html: Ditto.
* css3/filters/effect-drop-shadow.html: Ditto.
* css3/filters/effect-grayscale.html: Ditto.
* css3/filters/effect-hue-rotate.html: Ditto.
* css3/filters/effect-invert.html: Ditto.
* css3/filters/effect-opacity.html: Ditto.
* css3/filters/effect-saturate.html: Ditto.
* css3/filters/effect-sepia.html: Ditto.
* css3/filters/filter-repaint.html: Ditto.
* css3/filters/null-effect-check.html: Ditto.
* editing/selection/caret-mode-document-begin-end.html: Ditto.
* editing/selection/caret-mode-paragraph-keys-navigation.html: Ditto.
* fast/animation/request-animation-frame-disabled.html: Ditto.
* fast/canvas/canvas-blend-image.html: Ditto.
* fast/canvas/canvas-blend-solid.html: Ditto.
* fast/canvas/canvas-imageSmoothingQuality.html: Ditto.
* fast/canvas/drawImage-with-small-values.html: Ditto.
* fast/images/exif-orientation-composited.html: Ditto.
* fast/images/exif-orientation-css.html: Ditto.
* fast/images/exif-orientation.html: Ditto.
* fast/images/image-controls-basic.html: Ditto.
* fast/parser/pre-html5-parser-quirks.html: Ditto.
* fast/repaint/no-caret-repaint-in-non-content-editable-element.html: Ditto.
* http/tests/appcache/disabled.html: Ditto.
* http/tests/contentextensions/block-cookies-in-ping.html: Ditto.
* http/tests/contentextensions/block-ping.html: Ditto.
* http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html: Ditto.
* http/tests/contentextensions/hide-on-ping.html: Ditto.
* http/tests/misc/favicon-loads-with-icon-loading-override.html: Ditto.
* http/tests/navigation/ping-attribute/anchor-cookie.html: Ditto.
* http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: Ditto.
* http/tests/navigation/ping-attribute/anchor-cross-origin.html: Ditto.
* http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html: Ditto.
* http/tests/navigation/ping-attribute/anchor-same-origin.html: Ditto.
* http/tests/navigation/ping-attribute/area-cookie.html: Ditto.
* http/tests/navigation/ping-attribute/area-cross-origin-from-https.html: Ditto.
* http/tests/navigation/ping-attribute/area-cross-origin.html: Ditto.
* http/tests/navigation/ping-attribute/area-same-origin.html: Ditto.
* http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html: Ditto.
* imported/blink/fast/css/image-orientation/image-orientation-dynamic-expected.html: Ditto.
* loader/meta-refresh-disabled.html: Ditto.
* media/crash-closing-page-with-media-as-plugin-fallback.html: Ditto.
* platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt: Removed.
Mac WK1 now produces the same output as other platforms.
* platform/mac/TestExpectations: Remove the failure for FrameFlattening now that the test
uses internals.settings.set*.
* platform/mac/fast/frames/flattening/set-preference.html: Use internals.settings.set*.
* plugins/crash-restoring-plugin-page-from-page-cache.html: Ditto.
* plugins/frameset-with-plugin-frame.html: Ditto.
* plugins/netscape-plugin-page-cache-works.html: Ditto.

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

66 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/gtk/caret-browsing-select-focus.html
LayoutTests/accessibility/gtk/caret-browsing-text-focus.html
LayoutTests/accessibility/gtk/caret-offsets-and-extraneous-white-spaces.html
LayoutTests/accessibility/gtk/caret-offsets.html
LayoutTests/accessibility/gtk/text-in-span-block-in-a-block.html
LayoutTests/css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html
LayoutTests/css3/blending/blend-mode-simple.html
LayoutTests/css3/blending/effect-background-blend-mode.html
LayoutTests/css3/filters/blur-filter-page-scroll-parents.html
LayoutTests/css3/filters/blur-filter-page-scroll-self.html
LayoutTests/css3/filters/blur-filter-page-scroll.html
LayoutTests/css3/filters/effect-blur.html
LayoutTests/css3/filters/effect-brightness-clamping.html
LayoutTests/css3/filters/effect-brightness.html
LayoutTests/css3/filters/effect-combined.html
LayoutTests/css3/filters/effect-contrast.html
LayoutTests/css3/filters/effect-drop-shadow.html
LayoutTests/css3/filters/effect-grayscale.html
LayoutTests/css3/filters/effect-hue-rotate.html
LayoutTests/css3/filters/effect-invert.html
LayoutTests/css3/filters/effect-opacity.html
LayoutTests/css3/filters/effect-saturate.html
LayoutTests/css3/filters/effect-sepia.html
LayoutTests/css3/filters/filter-repaint.html
LayoutTests/css3/filters/null-effect-check.html
LayoutTests/editing/selection/caret-mode-document-begin-end.html
LayoutTests/editing/selection/caret-mode-paragraph-keys-navigation.html
LayoutTests/fast/animation/request-animation-frame-disabled.html
LayoutTests/fast/canvas/canvas-blend-image.html
LayoutTests/fast/canvas/canvas-blend-solid.html
LayoutTests/fast/canvas/canvas-imageSmoothingQuality.html
LayoutTests/fast/canvas/drawImage-with-small-values.html
LayoutTests/fast/images/exif-orientation-composited.html
LayoutTests/fast/images/exif-orientation-css.html
LayoutTests/fast/images/exif-orientation.html
LayoutTests/fast/images/image-controls-basic.html
LayoutTests/fast/parser/pre-html5-parser-quirks.html
LayoutTests/fast/repaint/no-caret-repaint-in-non-content-editable-element.html
LayoutTests/http/tests/appcache/disabled.html
LayoutTests/http/tests/contentextensions/block-cookies-in-ping.html
LayoutTests/http/tests/contentextensions/block-ping.html
LayoutTests/http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html
LayoutTests/http/tests/contentextensions/hide-on-ping.html
LayoutTests/http/tests/misc/favicon-loads-with-icon-loading-override.html
LayoutTests/http/tests/navigation/ping-attribute/anchor-cookie.html
LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html
LayoutTests/http/tests/navigation/ping-attribute/anchor-cross-origin.html
LayoutTests/http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html
LayoutTests/http/tests/navigation/ping-attribute/anchor-same-origin.html
LayoutTests/http/tests/navigation/ping-attribute/area-cookie.html
LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin-from-https.html
LayoutTests/http/tests/navigation/ping-attribute/area-cross-origin.html
LayoutTests/http/tests/navigation/ping-attribute/area-same-origin.html
LayoutTests/http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html
LayoutTests/imported/blink/fast/css/image-orientation/image-orientation-dynamic-expected.html
LayoutTests/loader/meta-refresh-disabled.html
LayoutTests/media/crash-closing-page-with-media-as-plugin-fallback.html
LayoutTests/platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt [deleted file]
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/mac/fast/frames/flattening/set-preference.html
LayoutTests/plugins/crash-restoring-plugin-page-from-page-cache.html
LayoutTests/plugins/frameset-with-plugin-frame.html
LayoutTests/plugins/netscape-plugin-page-cache-works.html
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp

index 3836500..d984e6c 100644 (file)
@@ -1,3 +1,83 @@
+2017-06-23  Frederic Wang  <fwang@igalia.com>
+
+        Use window.internals instead of overridePreference to set WebCore settings in tests
+        https://bugs.webkit.org/show_bug.cgi?id=173714
+
+        Reviewed by Simon Fraser.
+
+        This commit is a first step to replace the use of testRunner.overridePreference with
+        internals.settings.set* calls in tests. Such a call will fail immediately and obviously if
+        its a function that does not exist, and these settings are restored properly between tests.
+        Some preferences that do not have a WebCore setting or an internals.settings setter are not
+        handled yet. The temporary failure added in r218480 for fast/frames/flattening/set-preference
+        is removed and so is a custom expectation caret-mode-document-begin-end for Mac WK1.
+
+        * accessibility/gtk/caret-browsing-select-focus.html: Use internals.settings.set* function.
+        * accessibility/gtk/caret-browsing-text-focus.html: Ditto.
+        * accessibility/gtk/caret-offsets-and-extraneous-white-spaces.html: Ditto.
+        * accessibility/gtk/caret-offsets.html: Ditto.
+        * accessibility/gtk/text-in-span-block-in-a-block.html: Ditto.
+        * css3/blending/blend-mode-isolation-turn-off-self-painting-layer1.html: Ditto.
+        * css3/blending/blend-mode-simple.html: Ditto.
+        * css3/blending/effect-background-blend-mode.html: Ditto.
+        * css3/filters/blur-filter-page-scroll-parents.html: Ditto.
+        * css3/filters/blur-filter-page-scroll-self.html: Ditto.
+        * css3/filters/blur-filter-page-scroll.html: Ditto.
+        * css3/filters/effect-blur.html: Ditto.
+        * css3/filters/effect-brightness-clamping.html: Ditto.
+        * css3/filters/effect-brightness.html: Ditto.
+        * css3/filters/effect-combined.html: Ditto.
+        * css3/filters/effect-contrast.html: Ditto.
+        * css3/filters/effect-drop-shadow.html: Ditto.
+        * css3/filters/effect-grayscale.html: Ditto.
+        * css3/filters/effect-hue-rotate.html: Ditto.
+        * css3/filters/effect-invert.html: Ditto.
+        * css3/filters/effect-opacity.html: Ditto.
+        * css3/filters/effect-saturate.html: Ditto.
+        * css3/filters/effect-sepia.html: Ditto.
+        * css3/filters/filter-repaint.html: Ditto.
+        * css3/filters/null-effect-check.html: Ditto.
+        * editing/selection/caret-mode-document-begin-end.html: Ditto.
+        * editing/selection/caret-mode-paragraph-keys-navigation.html: Ditto.
+        * fast/animation/request-animation-frame-disabled.html: Ditto.
+        * fast/canvas/canvas-blend-image.html: Ditto.
+        * fast/canvas/canvas-blend-solid.html: Ditto.
+        * fast/canvas/canvas-imageSmoothingQuality.html: Ditto.
+        * fast/canvas/drawImage-with-small-values.html: Ditto.
+        * fast/images/exif-orientation-composited.html: Ditto.
+        * fast/images/exif-orientation-css.html: Ditto.
+        * fast/images/exif-orientation.html: Ditto.
+        * fast/images/image-controls-basic.html: Ditto.
+        * fast/parser/pre-html5-parser-quirks.html: Ditto.
+        * fast/repaint/no-caret-repaint-in-non-content-editable-element.html: Ditto.
+        * http/tests/appcache/disabled.html: Ditto.
+        * http/tests/contentextensions/block-cookies-in-ping.html: Ditto.
+        * http/tests/contentextensions/block-ping.html: Ditto.
+        * http/tests/contentextensions/hide-on-ping-with-ping-that-redirects.html: Ditto.
+        * http/tests/contentextensions/hide-on-ping.html: Ditto.
+        * http/tests/misc/favicon-loads-with-icon-loading-override.html: Ditto.
+        * http/tests/navigation/ping-attribute/anchor-cookie.html: Ditto.
+        * http/tests/navigation/ping-attribute/anchor-cross-origin-from-https.html: Ditto.
+        * http/tests/navigation/ping-attribute/anchor-cross-origin.html: Ditto.
+        * http/tests/navigation/ping-attribute/anchor-ping-and-follow-redirect-when-sending-ping.html: Ditto.
+        * http/tests/navigation/ping-attribute/anchor-same-origin.html: Ditto.
+        * http/tests/navigation/ping-attribute/area-cookie.html: Ditto.
+        * http/tests/navigation/ping-attribute/area-cross-origin-from-https.html: Ditto.
+        * http/tests/navigation/ping-attribute/area-cross-origin.html: Ditto.
+        * http/tests/navigation/ping-attribute/area-same-origin.html: Ditto.
+        * http/tests/security/mixedContent/insecure-script-in-data-iframe-in-main-frame-blocked.html: Ditto.
+        * imported/blink/fast/css/image-orientation/image-orientation-dynamic-expected.html: Ditto.
+        * loader/meta-refresh-disabled.html: Ditto.
+        * media/crash-closing-page-with-media-as-plugin-fallback.html: Ditto.
+        * platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt: Removed.
+        Mac WK1 now produces the same output as other platforms.
+        * platform/mac/TestExpectations: Remove the failure for FrameFlattening now that the test
+        uses internals.settings.set*.
+        * platform/mac/fast/frames/flattening/set-preference.html: Use internals.settings.set*.
+        * plugins/crash-restoring-plugin-page-from-page-cache.html: Ditto.
+        * plugins/frameset-with-plugin-frame.html: Ditto.
+        * plugins/netscape-plugin-page-cache-works.html: Ditto.
+
 2017-06-23  Chris Dumez  <cdumez@apple.com>
 
         [mac-wk1] requestAnimationFrame callbacks may not get serviced
index 0782d31..795a30d 100644 (file)
@@ -13,8 +13,8 @@
 <script>
 description("This tests caret browsing for html select elements.");
 
-if (window.testRunner) {
-  testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+if (window.testRunner && window.internals) {
+  internals.settings.setCaretBrowsingEnabled(true);
   testRunner.dumpAsText();
 
   if (window.accessibilityController) {
index d01ebe0..d292d97 100644 (file)
@@ -11,8 +11,8 @@
 <script>
 description("This tests the FOCUSABLE and FOCUSED states for text objects.");
 
-if (window.testRunner) {
-  testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+if (window.testRunner && window.internals) {
+  internals.settings.setCaretBrowsingEnabled(true);
   testRunner.dumpAsText();
 
   if (window.accessibilityController) {
index 42fd77d..0455aa1 100644 (file)
@@ -30,8 +30,8 @@ function resetCaretOffsetForObject(object, offset)
     setCaretOffset(object, offset);
 }
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+if (window.testRunner && window.internals) {
+    internals.settings.setCaretBrowsingEnabled(true);
     testRunner.dumpAsText();
 }
 
index 4f513ed..a18b5f7 100644 (file)
@@ -48,10 +48,10 @@ function resetCaretOffsetForObject(object, offset)
     setCaretOffset(object, offset);
 }
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+if (window.internals)
+    internals.settings.setCaretBrowsingEnabled(true);
+if (window.testRunner)
     testRunner.dumpAsText();
-}
 
 if (window.accessibilityController) {
     window.jsTestIsAsync = true;
index 5fec489..ae86069 100644 (file)
@@ -66,10 +66,10 @@ function globalListener(object, name, offset)
     }
 }
 
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+if (window.internals)
+    internals.settings.setCaretBrowsingEnabled(true);
+if (window.testRunner)
     testRunner.dumpAsText();
-}
 
 if (window.accessibilityController) {
     var i, linkText, accText, id;
index eab9786..c1a5a5a 100644 (file)
@@ -3,8 +3,8 @@
 <link rel="stylesheet" href="resources/blending-style.css">
 
 <script>
-  if (window.testRunner)
-      window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
+  if (window.internals)
+      window.internals.settings.setAcceleratedCompositingEnabled(true);
 </script>
 
 <!-- This test checks that an element with overflow hidden will be able to stop isolating after dinamically removing mix-blend-mode on descendants. -->
index 8529f33..881ced8 100644 (file)
@@ -1,8 +1,8 @@
 <!DOCTYPE HTML>
 <head>
     <script>
-        if (window.testRunner)
-            window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
+      if (window.internals)
+          window.internals.settings.setAcceleratedCompositingEnabled(true);
     </script>
 
     <style>
index 489dd96..1f831bf 100644 (file)
@@ -1,8 +1,7 @@
 <!DOCTYPE HTML>
 <script>
-    if (window.testRunner) {
-        window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
-    }
+    if (window.internals)
+        window.internals.settings.setAcceleratedCompositingEnabled(true);
     if (window.testRunner)
       window.testRunner.dumpAsText(true);
 </script>
index 361fe69..18f3992 100644 (file)
@@ -7,9 +7,9 @@
 <html>
     <head>
         <script>
-            if (window.testRunner) {
+            if (window.internals) {
                 // Force software rendering mode.
-                window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+                window.internals.settings.setAcceleratedCompositingEnabled(false);
             }
         </script>
         <style>
index 5d0e2ac..a6c2f68 100644 (file)
@@ -7,9 +7,9 @@
 <html>
     <head>
         <script>
-            if (window.testRunner) {
+            if (window.internals) {
                 // Force software rendering mode.
-                window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+                window.internals.settings.setAcceleratedCompositingEnabled(false);
             }
         </script>
         <style>
index 05e23b2..d20b133 100644 (file)
@@ -7,9 +7,9 @@
 <html>
     <head>
         <script>
-            if (window.testRunner) {
+            if (window.internals) {
                 // Force software rendering mode.
-                window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+                window.internals.settings.setAcceleratedCompositingEnabled(false);
             }
         </script>
         <style>
index 7818218..780227f 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <style>
index fea5a3a..c72f371 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: brightness(-1) brightness(1)" src="resources/reference.png">
index 6768ffb..4132c5c 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: brightness(-1)" src="resources/reference.png">
index afbe983..f44f436 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <style>
index 7d8845f..5c5f4dc 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: contrast(0)" src="resources/reference.png">
index 40e6e19..1e8cb66 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <style>
index 469a4b6..b0e43da 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: grayscale(0)" src="resources/reference.png">
index 5b9c8dc..5e5b090 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: hue-rotate(0deg)" src="resources/reference.png">
index 600ffd3..065553a 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: invert(0)" src="resources/reference.png">
index c1c8295..bee805c 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: opacity(0)" src="resources/reference.png">
index 7b3e1f1..403a872 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: saturate(0)" src="resources/reference.png">
index 72b0898..8d3f1b7 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <img style="filter: sepia(0)" src="resources/reference.png">
index 94522ea..c96e748 100644 (file)
   </style>
   <script src="../../fast/repaint/resources/repaint.js"></script>
   <script>
-      if (window.testRunner) {
+      if (window.testRunner)
           testRunner.dumpAsText(true);
+      if (window.internals) {
           // Force software rendering mode.
-          window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+          window.internals.settings.setAcceleratedCompositingEnabled(false);
       }
 
       function repaintTest()
index 7ee0c25..a55530a 100644 (file)
@@ -1,7 +1,7 @@
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // Force software rendering mode.
-    window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "0");
+    window.internals.settings.setAcceleratedCompositingEnabled(false);
 }
 </script>
 <style>
index 52b3258..82ff571 100644 (file)
@@ -15,8 +15,8 @@
 <script>
 description("This tests direct navigation to the begin and end of the document in caret mode.");
 
-if (window.testRunner) {
-  testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+if (window.testRunner && window.internals) {
+  internals.settings.setCaretBrowsingEnabled(true);
   testRunner.dumpAsText();
   testRunner.dumpEditingCallbacks();
 
index ea898ca..363120c 100644 (file)
@@ -11,7 +11,7 @@
 description("This tests that keys navigation through a paragraph work as expected when in caret mode, also with shift and ctrl modifiers.");
 
 if (window.testRunner && window.internals) {
-  testRunner.overridePreference("WebKitEnableCaretBrowsing", true);
+  internals.settings.setCaretBrowsingEnabled(true);
   testRunner.dumpAsText();
   internals.settings.setEditingBehavior('mac');
 
index 77f9cfd..be1c75b 100644 (file)
@@ -2,8 +2,8 @@
 <html>
 <head>
 <script>
-if (window.testRunner)
-    window.testRunner.overridePreference("WebKitRequestAnimationFrameEnabled", "0");
+if (window.internals)
+    internals.settings.setRequestAnimationFrameEnabled(false);
 </script>
 <script src="../../resources/js-test-pre.js"></script>
 </head>
index 6a21c67..b9ed444 100644 (file)
@@ -6,8 +6,8 @@
 <body>
 <script>
 description("Series of tests to ensure correct results on applying different blend modes.");
-if (self.testRunner)
-  testRunner.overridePreference("WebKitCanvasUsesAcceleratedDrawing", 0);
+if (window.internals)
+  internals.settings.setCanvasUsesAcceleratedDrawing(false);
 
 var tmpimg = document.createElement('canvas');
 tmpimg.width = 200;
index 03076bf..4a34c9b 100644 (file)
@@ -6,8 +6,8 @@
 <body>
 <script>
 description("Series of tests to ensure correct results on applying different blend modes.");
-if (self.testRunner)
-   testRunner.overridePreference("WebKitCanvasUsesAcceleratedDrawing", 0);
+if (window.internals)
+  internals.settings.setCanvasUsesAcceleratedDrawing(false);
 
 var tmpimg = document.createElement('canvas');
 tmpimg.width = 200;
index 3bc2a90..bdfe097 100644 (file)
@@ -9,8 +9,8 @@
 
 description("Tests for the imageSmoothingQuality attribute.");
 
-if (window.testRunner)
-   testRunner.overridePreference("WebKitCanvasUsesAcceleratedDrawing", 0);
+if (window.internals)
+  internals.settings.setCanvasUsesAcceleratedDrawing(false);
 
 var source = document.getElementById("source");
 source.width = 60;
index 7d1e5db..e68877d 100644 (file)
@@ -6,8 +6,8 @@
 <body>
 <script>
 description("Test canvas context after draw too small surface.");
-if (self.testRunner)
-  testRunner.overridePreference("WebKitCanvasUsesAcceleratedDrawing", 0);
+if (window.internals)
+  internals.settings.setCanvasUsesAcceleratedDrawing(false);
 
 var tmpimg = document.createElement('canvas');
 tmpimg.width = 720;
index 6ec4ac7..98cff09 100644 (file)
@@ -1,10 +1,10 @@
 <html>
 <head>
 <script>
-if (window.testRunner) {
-    testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1);
+if (window.internals)
+    internals.settings.setShouldRespectImageOrientation(true);
+if (window.testRunner)
     testRunner.dumpAsText(true);
-}
 
 function log(str) {
     var li = document.createElement("li");
index 218a532..7417f55 100644 (file)
@@ -1,10 +1,10 @@
 <html>
 <head>
 <script>
-if (window.testRunner) {
-    testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1);
+if (window.internals)
+    internals.settings.setShouldRespectImageOrientation(true);
+if (window.testRunner)
     testRunner.dumpAsText(true);
-}
 
 function log(str) {
     var li = document.createElement("li");
index 462b65c..0d8c83b 100644 (file)
@@ -1,10 +1,10 @@
 <html>
 <head>
 <script>
-if (window.testRunner) {
-    testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1);
+if (window.internals)
+    internals.settings.setShouldRespectImageOrientation(true);
+if (window.testRunner)
     testRunner.dumpAsText(true);
-}
 
 function log(str) {
     var li = document.createElement("li");
index ecc49ef..42d4926 100644 (file)
@@ -1,6 +1,6 @@
 <script>
-if (window.testRunner)
-       testRunner.overridePreference('WebKitImageControlsEnabled', 1);
+if (window.internals)
+       internals.settings.setImageControlsEnabled(true);
 
 </script>
 <body>
index 45c9132..e638ffe 100644 (file)
@@ -1,6 +1,6 @@
 <script>
-    if (window.testRunner) {
-        testRunner.overridePreference("WebKitUsePreHTML5ParserQuirks", "1");
+    if (window.testRunner && window.internals) {
+        internals.settings.setUsePreHTML5ParserQuirks(true);
         testRunner.dumpAsText();
         testRunner.dumpChildFramesAsText();
     }
index 83f8c51..d080f8d 100644 (file)
@@ -2,12 +2,12 @@
 <head>
 <script src="resources/repaint.js"></script>
 <script>
-if (window.testRunner) {
+if (window.internals) {
     // By definition, when caret browsing is enabled we always paint the caret.
     // So, this test is only applicable when caret browsing is disabled because
     // non-content-editable elements won't cause the caret to be drawn since they
     // are not editable.
-    testRunner.overridePreference("WebKitEnableCaretBrowsing", false);
+    internals.settings.setCaretBrowsingEnabled(false);
 }
 function repaintTest()
 {
index 9389cd5..618c345 100644 (file)
@@ -3,10 +3,10 @@
 <p>Test to ensure the the window.applicationCache attribute is defined but non-functional with the feature disabled.</p>
 <div id=result></div>
 <script>
-    if (window.testRunner) {
-        testRunner.overridePreference("WebKitOfflineWebApplicationCacheEnabled", false);
+    if (window.internals)
+        internals.settings.setOfflineWebApplicationCacheEnabled(false);
+    if (window.testRunner)
         testRunner.dumpAsText();
-    }
 
     function log(message)
     {
index bacd00d..6ef70a3 100644 (file)
@@ -1,9 +1,9 @@
 <head>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 1238c47..dc3f54d 100644 (file)
@@ -1,9 +1,9 @@
 <head>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 5888018..ae6af0d 100644 (file)
@@ -1,9 +1,9 @@
 <head>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 6a2427c..3a8d76e 100644 (file)
@@ -1,9 +1,9 @@
 <head>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.dumpChildFramesAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 9602c0e..8cacc58 100644 (file)
@@ -3,12 +3,12 @@
 <script>
 function runTest()
 {
-    if (window.testRunner) {
+    if (window.testRunner && window.internals) {
         testRunner.dumpAsText();
         testRunner.dumpResourceLoadCallbacks();
         testRunner.setIconDatabaseEnabled(true);
         testRunner.overridePreference("WebKitDisplayImagesKey", 0);
-        testRunner.overridePreference("WebKitLoadSiteIconsKey", 1);
+        internals.setLoadsSiteIconsIgnoringImageLoadingSetting(true);
         testRunner.queueReload();
     }
 }
index 1773500..d4acf12 100644 (file)
@@ -3,9 +3,9 @@
 <title>Ping</title>
 <script src="resources/utilities.js"></script>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 13c12bf..f2cb23d 100644 (file)
@@ -17,9 +17,9 @@ var testCalled = false;
 
 function test() {
     if (!testCalled) {
-        if (window.testRunner) {
+        if (window.testRunner && window.internals) {
             testRunner.dumpAsText();
-            testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+            internals.settings.setHyperlinkAuditingEnabled(true);
             testRunner.waitUntilDone();
         }
         testCalled = true;
index 1a539c0..7004798 100644 (file)
@@ -9,9 +9,9 @@ var testCalled = false;
 
 function test() {
     if (!testCalled) {
-        if (window.testRunner) {
+        if (window.testRunner && window.internals) {
             testRunner.dumpAsText();
-            testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+            internals.settings.setHyperlinkAuditingEnabled(true);
             testRunner.waitUntilDone();
         }
         testCalled = true;
index 3fcf3cc..44fecc3 100644 (file)
@@ -3,9 +3,9 @@
 <head>
 <script src="resources/utilities.js"></script>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index a0d166a..5452db0 100644 (file)
@@ -9,9 +9,9 @@ var testCalled = false;
 
 function test() {
     if (!testCalled) {
-        if (window.testRunner) {
+        if (window.testRunner && window.internals) {
             testRunner.dumpAsText();
-            testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+            internals.settings.setHyperlinkAuditingEnabled(true);
             testRunner.waitUntilDone();
         }
         testCalled = true;
index 6c2c6a5..00ffcf7 100644 (file)
@@ -3,9 +3,9 @@
 <head>
 <script src="resources/utilities.js"></script>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index ef2ce4c..bab459b 100644 (file)
@@ -3,9 +3,9 @@
 <head>
 <script src="resources/utilities.js"></script>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 2e1c01c..4e53f14 100644 (file)
@@ -3,9 +3,9 @@
 <head>
 <script src="resources/utilities.js"></script>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index f9c2436..e69cfda 100644 (file)
@@ -3,9 +3,9 @@
 <head>
 <script src="resources/utilities.js"></script>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
-    testRunner.overridePreference("WebKitHyperlinkAuditingEnabled", 1);
+    internals.settings.setHyperlinkAuditingEnabled(true);
     testRunner.waitUntilDone();
 }
 
index 13e0891..a6af969 100644 (file)
@@ -1,12 +1,12 @@
 <html>
 <body>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.waitUntilDone();
     testRunner.dumpAsText();
     testRunner.setCanOpenWindows();
     testRunner.setCloseRemainingWindowsWhenComplete(true);
-    testRunner.overridePreference("WebKitAllowRunningInsecureContent", false);
+    internals.settings.setAllowRunningOfInsecureContent(false);
 }
 window.addEventListener("message", function (e) {
   if (window.testRunner)
index 249368a..c3fee48 100644 (file)
@@ -1,8 +1,8 @@
 <html>
 <head>
 <script>
-if (window.testRunner)
-  testRunner.overridePreference('WebKitShouldRespectImageOrientation', 1);
+if (window.internals)
+  internals.settings.setShouldRespectImageOrientation(true);
 </script>
 </head>
 <body>
index f41fb8b..d4d3f91 100644 (file)
@@ -1,7 +1,7 @@
 <head>
 <script>
-if (window.testRunner) {
-    testRunner.overridePreference("WebKitHTTPEquivEnabled", "0");
+if (window.testRunner && window.internals) {
+    internals.settings.setHttpEquivEnabled(false);
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
 }
index 4cb44b1..894c874 100644 (file)
@@ -9,11 +9,11 @@ If it doesn't crash, it passes.<br>
 <div id="result"></div><br>
 
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-    testRunner.overridePreference("WebKitPageCacheSupportsPluginsPreferenceKey", 1);
+    internals.settings.setPageCacheSupportsPlugins(true);
     testRunner.setCanOpenWindows(true);
     testRunner.setCloseRemainingWindowsWhenComplete(true);
     var button = document.getElementById("button");
diff --git a/LayoutTests/platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt b/LayoutTests/platform/mac-wk1/editing/selection/caret-mode-document-begin-end-expected.txt
deleted file mode 100644 (file)
index 8862199..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-First text line.
-Second text line.
-Third text line.
-A paragraph to finish.
-
-This tests direct navigation to the begin and end of the document in caret mode.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
index e3289b3..59dc704 100644 (file)
@@ -498,9 +498,6 @@ webkit.org/b/112532 fast/frames/flattening/frameset-flattening-subframesets.html
 webkit.org/b/106185 fast/frames/flattening/iframe-flattening-fixed-height.html [ Failure Pass ]
 webkit.org/b/106185 fast/frames/flattening/frameset-flattening-grid.html [ Failure Pass ]
 
-# FrameFlattening enum preferences can not be overridden.
-webkit.org/b/128594 platform/mac/fast/frames/flattening/set-preference.html [ Failure ]
-
 webkit.org/b/73766 css3/unicode-bidi-isolate-aharon-failing.html [ ImageOnlyFailure ]
 
 # Failing ref tests
index db3fec3..8972432 100644 (file)
@@ -9,8 +9,8 @@ iframe {
 </style>
 <script src="../../../../../resources/check-layout.js"></script>
 <script type="text/javascript">
-if (window.testRunner)
-    testRunner.overridePreference("WebKitFrameFlatteningEnabled", "1");
+if (window.internals)
+    internals.settings.setFrameFlattening("FullyEnabled");
 
 window.onload = function()
 {
index 1c5b3be..29eccf8 100644 (file)
@@ -1,10 +1,10 @@
 <head>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-    testRunner.overridePreference("WebKitPageCacheSupportsPluginsPreferenceKey", 1);
+    internals.settings.setPageCacheSupportsPlugins(true);
 }
 
 function pageShown() {
index a4256d7..4bb532f 100644 (file)
@@ -5,7 +5,7 @@
         testRunner.waitUntilDone();
         internals.settings.setFrameFlattening("FullyEnabled")
         testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-        testRunner.overridePreference("WebKitPageCacheSupportsPluginsPreferenceKey", 1);
+        internals.settings.setPageCacheSupportsPlugins(true);
     }
 </script>
 
index 11b1fd7..e1666af 100644 (file)
@@ -1,10 +1,10 @@
 <html>
 <script>
-if (window.testRunner) {
+if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
     testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
-    testRunner.overridePreference("WebKitPageCacheSupportsPluginsPreferenceKey", 1);
+    internals.settings.setPageCacheSupportsPlugins(true);
 }
 
 var savedTestObject = null;
index a2e152f..14689a2 100644 (file)
@@ -1,3 +1,17 @@
+2017-06-23  Frederic Wang  <fwang@igalia.com>
+
+        Use window.internals instead of overridePreference to set WebCore settings in tests
+        https://bugs.webkit.org/show_bug.cgi?id=173714
+
+        Reviewed by Simon Fraser.
+
+        This commit remove preference to settings mapping in overrideBoolPreferenceForTestRunner that
+        are no longer necessary after the changes done in LayoutTests.
+
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Remove mapping for preferences
+        that no longer require testRunner.overridePreference calls in tests.
+
 2017-06-23  Brent Fulgham  <bfulgham@apple.com>
 
         Avoid moving the same vector multiple times
index 457ef82..ae9d94f 100644 (file)
@@ -233,22 +233,15 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
 
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
-    macro(WebKitAcceleratedCompositingEnabled, AcceleratedCompositingEnabled, acceleratedCompositingEnabled) \
-    macro(WebKitCanvasUsesAcceleratedDrawing, CanvasUsesAcceleratedDrawing, canvasUsesAcceleratedDrawing) \
     macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \
     macro(WebKitJavaScriptEnabled, ScriptEnabled, javaScriptEnabled) \
-    macro(WebKitLoadSiteIconsKey, LoadsSiteIconsIgnoringImageLoadingSetting, loadsSiteIconsIgnoringImageLoadingPreference) \
-    macro(WebKitOfflineWebApplicationCacheEnabled, OfflineWebApplicationCacheEnabled, offlineWebApplicationCacheEnabled) \
-    macro(WebKitPageCacheSupportsPluginsPreferenceKey, PageCacheSupportsPlugins, pageCacheSupportsPlugins) \
     macro(WebKitPluginsEnabled, PluginsEnabled, pluginsEnabled) \
     macro(WebKitUsesPageCachePreferenceKey, UsesPageCache, usesPageCache) \
     macro(WebKitWebAudioEnabled, WebAudioEnabled, webAudioEnabled) \
     macro(WebKitWebGLEnabled, WebGLEnabled, webGLEnabled) \
     macro(WebKitXSSAuditorEnabled, XSSAuditorEnabled, xssAuditorEnabled) \
     macro(WebKitShouldRespectImageOrientation, ShouldRespectImageOrientation, shouldRespectImageOrientation) \
-    macro(WebKitEnableCaretBrowsing, CaretBrowsingEnabled, caretBrowsingEnabled) \
     macro(WebKitDisplayImagesKey, LoadsImagesAutomatically, loadsImagesAutomatically) \
-    macro(WebKitHTTPEquivEnabled, HttpEquivEnabled, httpEquivEnabled) \
     macro(WebKitVisualViewportEnabled, VisualViewportEnabled, visualViewportEnabled) \
     macro(WebKitLargeImageAsyncDecodingEnabled, LargeImageAsyncDecodingEnabled, largeImageAsyncDecodingEnabled) \
     macro(WebKitAnimatedImageAsyncDecodingEnabled, AnimatedImageAsyncDecodingEnabled, animatedImageAsyncDecodingEnabled) \