Title: [129430] trunk
Revision
129430
Author
[email protected]
Date
2012-09-24 17:05:03 -0700 (Mon, 24 Sep 2012)

Log Message

[WK2] TestRunner does not support overridePreference with value "0"
https://bugs.webkit.org/show_bug.cgi?id=97457

Patch by Christophe Dumez <[email protected]> on 2012-09-24
Reviewed by Alexey Proskuryakov.

Tools:

testRunner.overridePreference() was marked as taking a boolean
in argument in testRunner.idl even though the test cases are
passing strings to it. The current code works if the test
case wants to enable a setting and therefore passes "1" string.
However, if the test wants to disable a setting and passes "0"
string, the current code also evaluates this to true causing
certain test cases to fail.

The argument to testRunner.overridePreference() is now of string
type and a function has been added to convert the string passed
by the test to a boolean value.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::toBool):
(WTR):
(WTR::TestRunner::overridePreference):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(TestRunner):

LayoutTests:

Unskip fast/regions/css-regions-disabled.html test case for
WebKit2 now that WebKitTestRunner actually supports overriding
a boolean preference with "0" value (to disable it).

* platform/efl-wk2/TestExpectations:
* platform/gtk-wk2/TestExpectations:
* platform/mac-wk2/Skipped:
* platform/qt-5.0-wk2/Skipped:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (129429 => 129430)


--- trunk/LayoutTests/ChangeLog	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/LayoutTests/ChangeLog	2012-09-25 00:05:03 UTC (rev 129430)
@@ -1,3 +1,19 @@
+2012-09-24  Christophe Dumez  <[email protected]>
+
+        [WK2] TestRunner does not support overridePreference with value "0"
+        https://bugs.webkit.org/show_bug.cgi?id=97457
+
+        Reviewed by Alexey Proskuryakov.
+
+        Unskip fast/regions/css-regions-disabled.html test case for
+        WebKit2 now that WebKitTestRunner actually supports overriding
+        a boolean preference with "0" value (to disable it).
+
+        * platform/efl-wk2/TestExpectations:
+        * platform/gtk-wk2/TestExpectations:
+        * platform/mac-wk2/Skipped:
+        * platform/qt-5.0-wk2/Skipped:
+
 2012-09-24  Roger Fong  <[email protected]>
 
         Unreviewed. Mark http/tests/security/inactive-document-with-empty-security-origin.html while Geoff Garen

Modified: trunk/LayoutTests/platform/efl-wk2/TestExpectations (129429 => 129430)


--- trunk/LayoutTests/platform/efl-wk2/TestExpectations	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/LayoutTests/platform/efl-wk2/TestExpectations	2012-09-25 00:05:03 UTC (rev 129430)
@@ -203,5 +203,3 @@
 # Fails after r128056.
 webkit.org/b/96794 inspector/console/alert-toString-exception.html [ Failure ]
 
-# CSS Regions Preference override fails.
-webkit.org/b/97457 fast/regions/css-regions-disabled.html [ Failure ]

Modified: trunk/LayoutTests/platform/gtk-wk2/TestExpectations (129429 => 129430)


--- trunk/LayoutTests/platform/gtk-wk2/TestExpectations	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/LayoutTests/platform/gtk-wk2/TestExpectations	2012-09-25 00:05:03 UTC (rev 129430)
@@ -476,8 +476,6 @@
 Bug(GTK) fast/loader/submit-form-while-parsing-2.html [ Failure ]
 Bug(GTK) fast/media/mq-transform-02.html [ Failure ]
 Bug(GTK) fast/media/mq-transform-03.html [ Failure ]
-Bug(GTK) fast/regions/css-regions-disabled.html [ Failure ]
-Bug(GTK) fast/regions/css-regions-disabled.html [ Failure ]
 Bug(GTK) fast/repaint/fixed-move-after-keyboard-scroll.html [ Failure ]
 Bug(GTK) fast/ruby/nested-ruby.html [ Failure ]
 Bug(GTK) fast/ruby/ruby-beforeafter.html [ Failure ]

Modified: trunk/LayoutTests/platform/mac-wk2/Skipped (129429 => 129430)


--- trunk/LayoutTests/platform/mac-wk2/Skipped	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/LayoutTests/platform/mac-wk2/Skipped	2012-09-25 00:05:03 UTC (rev 129430)
@@ -318,7 +318,6 @@
 fast/history/form-submit-in-frame-via-onclick.html
 fast/history/form-submit-in-frame.html
 fast/history/saves-state-after-frame-nav.html
-fast/regions/css-regions-disabled.html
 http/tests/inspector/extensions-ignore-cache.html
 http/tests/security/credentials-in-referer.html
 http/tests/workers/terminate-during-sync-operation.html

Modified: trunk/LayoutTests/platform/qt-5.0-wk2/Skipped (129429 => 129430)


--- trunk/LayoutTests/platform/qt-5.0-wk2/Skipped	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/LayoutTests/platform/qt-5.0-wk2/Skipped	2012-09-25 00:05:03 UTC (rev 129430)
@@ -507,10 +507,6 @@
 http/tests/security/storage-blocking-strengthened-plugin.html
 http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html
 
-# [Qt][WK2] fast/regions/css-regions-disabled.html fails
-# https://bugs.webkit.org/show_bug.cgi?id=97197
-fast/regions/css-regions-disabled.html
-
 # Unskipped by r129252 (wk2/Skipped list), but still fail on Qt WK2
 fast/dom/Geolocation/callback-exception.html
 fast/dom/Geolocation/callback-to-deleted-context.html

Modified: trunk/Tools/ChangeLog (129429 => 129430)


--- trunk/Tools/ChangeLog	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/Tools/ChangeLog	2012-09-25 00:05:03 UTC (rev 129430)
@@ -1,3 +1,30 @@
+2012-09-24  Christophe Dumez  <[email protected]>
+
+        [WK2] TestRunner does not support overridePreference with value "0"
+        https://bugs.webkit.org/show_bug.cgi?id=97457
+
+        Reviewed by Alexey Proskuryakov.
+
+        testRunner.overridePreference() was marked as taking a boolean
+        in argument in testRunner.idl even though the test cases are
+        passing strings to it. The current code works if the test
+        case wants to enable a setting and therefore passes "1" string.
+        However, if the test wants to disable a setting and passes "0"
+        string, the current code also evaluates this to true causing
+        certain test cases to fail.
+
+        The argument to testRunner.overridePreference() is now of string
+        type and a function has been added to convert the string passed
+        by the test to a boolean value.
+
+        * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::toBool):
+        (WTR):
+        (WTR::TestRunner::overridePreference):
+        * WebKitTestRunner/InjectedBundle/TestRunner.h:
+        (TestRunner):
+
 2012-09-24  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r129343.

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (129429 => 129430)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl	2012-09-25 00:05:03 UTC (rev 129430)
@@ -160,8 +160,7 @@
         // Cookies testing
         void setAlwaysAcceptCookies(in boolean accept);
 
-        // FIXME: handle non-boolean preferences.
-        void overridePreference(in DOMString preference, in boolean value);
+        void overridePreference(in DOMString preference, in DOMString value);
 
         // Page Visibility API
         void setPageVisibility(in DOMString state);

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (129429 => 129430)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2012-09-25 00:05:03 UTC (rev 129430)
@@ -649,11 +649,17 @@
     callTestRunnerCallback(SetBackingScaleFactorCallbackID);
 }
 
-void TestRunner::overridePreference(JSStringRef preference, bool value)
+static inline bool toBool(JSStringRef value)
 {
-    WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), value);
+    return JSStringIsEqualToUTF8CString(value, "true") || JSStringIsEqualToUTF8CString(value, "1");
 }
 
+void TestRunner::overridePreference(JSStringRef preference, JSStringRef value)
+{
+    // FIXME: handle non-boolean preferences.
+    WKBundleOverrideBoolPreferenceForTestRunner(InjectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), toWK(preference).get(), toBool(value));
+}
+
 void TestRunner::sendWebIntentResponse(JSStringRef reply)
 {
 #if ENABLE(WEB_INTENTS)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (129429 => 129430)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2012-09-24 23:57:24 UTC (rev 129429)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h	2012-09-25 00:05:03 UTC (rev 129430)
@@ -228,7 +228,7 @@
     void callFocusWebViewCallback();
     void callSetBackingScaleFactorCallback();
 
-    void overridePreference(JSStringRef preference, bool value);
+    void overridePreference(JSStringRef preference, JSStringRef value);
 
     // Web intents testing.
     void sendWebIntentResponse(JSStringRef reply);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to