Commit 69fd8c41 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

[WK2] TestRunner does not support overridePreference with value "0"

https://bugs.webkit.org/show_bug.cgi?id=97457

Patch by Christophe Dumez <christophe.dumez@intel.com> 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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 32f73c9f
2012-09-24 Christophe Dumez <christophe.dumez@intel.com>
[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 <roger_fong@apple.com>
 
Unreviewed. Mark http/tests/security/inactive-document-with-empty-security-origin.html while Geoff Garen
......@@ -203,5 +203,3 @@ Bug(EFL) http/tests/inspector/network/network-sidebar-width.html [ Failure ]
# 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 ]
......@@ -476,8 +476,6 @@ Bug(GTK) fast/forms/select-type-ahead-non-latin.html [ Failure ]
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 ]
......
......@@ -318,7 +318,6 @@ fast/frames/flattening/frameset-flattening-advanced.html
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
......
......@@ -507,10 +507,6 @@ http/tests/security/storage-blocking-loosened-private-browsing-plugin.html
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
......
2012-09-24 Christophe Dumez <christophe.dumez@intel.com>
[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 <webkit.review.bot@gmail.com>
 
Unreviewed, rolling out r129343.
......@@ -160,8 +160,7 @@ module WTR {
// 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);
......
......@@ -649,9 +649,15 @@ void TestRunner::callSetBackingScaleFactorCallback()
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)
......
......@@ -228,7 +228,7 @@ public:
void callFocusWebViewCallback();
void callSetBackingScaleFactorCallback();
void overridePreference(JSStringRef preference, bool value);
void overridePreference(JSStringRef preference, JSStringRef value);
// Web intents testing.
void sendWebIntentResponse(JSStringRef reply);
......
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