Allow setting preferences to false in WPT tests. closes #10161

This commit is contained in:
Awal Garg 2016-03-26 08:04:28 +05:30
parent f2f05869d6
commit b1ff30f752
7 changed files with 38 additions and 3 deletions

View file

@ -74,8 +74,8 @@ class ServoTestharnessExecutor(ProcessTestExecutor):
"-z", self.test_url(test)]
for stylesheet in self.browser.user_stylesheets:
args += ["--user-stylesheet", stylesheet]
for pref in test.environment.get('prefs', {}):
args += ["--pref", pref]
for pref, value in test.environment.get('prefs', {}).iteritems():
args += ["--pref", "%s=%s" % (pref, value)]
debug_args, command = browser_command(self.binary, args, self.debug_info)
self.command = command

View file

@ -6144,6 +6144,12 @@
"url": "/_mozilla/mozilla/parentnodes.html"
}
],
"mozilla/preferences.html": [
{
"path": "mozilla/preferences.html",
"url": "/_mozilla/mozilla/preferences.html"
}
],
"mozilla/preserve_wrapper_callback.html": [
{
"path": "mozilla/preserve_wrapper_callback.html",

View file

@ -0,0 +1,3 @@
[preferences.html]
type: testharness
prefs: [dom.testbinding.preference_value.falsy:false, dom.testbinding.preference_value.truthy:true]

View file

@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf-8">
<title></title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
var testBinding = new TestBinding();
assert_equals(typeof testBinding.BooleanMozPreference, "function");
assert_equals(testBinding.BooleanMozPreference("dom.testbinding.preference_value.falsy"), false);
assert_equals(testBinding.BooleanMozPreference("dom.testbinding.preference_value.truthy"), true);
}, "prefs");
</script>