Auto merge of #10204 - awalGarg:fix10161, r=Manishearth

Allow setting preferences to false in WPT tests

First patch to servo - apologies if I did something stupid :)

This is a fix for #10161. I have squashed the commits into one.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10204)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-03-27 00:46:55 +05:30
commit 4cb626ae29
7 changed files with 38 additions and 3 deletions

View file

@ -27,6 +27,7 @@ use js::jsval::{JSVal, NullValue};
use std::borrow::ToOwned;
use std::ptr;
use std::rc::Rc;
use util::prefs::{get_pref};
use util::str::DOMString;
#[dom_struct]
@ -486,6 +487,9 @@ impl TestBindingMethods for TestBinding {
fn PassVariadicUnion6(&self, _: Vec<UnsignedLongOrBoolean>) {}
fn PassVariadicAny(&self, _: *mut JSContext, _: Vec<HandleValue>) {}
fn PassVariadicObject(&self, _: *mut JSContext, _: Vec<*mut JSObject>) {}
fn BooleanMozPreference(&self, pref_name: DOMString) -> bool {
get_pref(pref_name.as_ref()).as_boolean().unwrap_or(false)
}
}
impl TestBinding {

View file

@ -398,4 +398,5 @@ interface TestBinding {
static attribute boolean booleanAttributeStatic;
static void receiveVoidStatic();
boolean BooleanMozPreference(DOMString pref_name);
};