aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-03-06 19:05:14 +0100
committerMs2ger <ms2ger@gmail.com>2014-03-06 19:05:14 +0100
commit9fe72eb37993bbe56802da30ade9d7c984e7b23d (patch)
treeac699a5eca1224e63e6a348d897f557dbb39111d /src/components/script/dom/testbinding.rs
parent48ebd2a5e304a0e48e01b1cfcbaa8ccc865e437d (diff)
downloadservo-9fe72eb37993bbe56802da30ade9d7c984e7b23d.tar.gz
servo-9fe72eb37993bbe56802da30ade9d7c984e7b23d.zip
Add interface codegen tests.
Diffstat (limited to 'src/components/script/dom/testbinding.rs')
-rw-r--r--src/components/script/dom/testbinding.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/components/script/dom/testbinding.rs b/src/components/script/dom/testbinding.rs
index 694ff1050c3..8173a9829aa 100644
--- a/src/components/script/dom/testbinding.rs
+++ b/src/components/script/dom/testbinding.rs
@@ -2,12 +2,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+use dom::bindings::js::JS;
use dom::bindings::utils::{Reflector, Reflectable};
+use dom::blob::Blob;
+use dom::window::Window;
use servo_util::str::DOMString;
#[deriving(Encodable)]
pub struct TestBinding {
reflector: Reflector,
+ window: JS<Window>,
}
impl TestBinding {
@@ -35,6 +39,8 @@ impl TestBinding {
pub fn SetDoubleAttribute(&self, _: f64) {}
pub fn StringAttribute(&self) -> DOMString { ~"" }
pub fn SetStringAttribute(&self, _: DOMString) {}
+ pub fn InterfaceAttribute(&self) -> JS<Blob> { Blob::new(&self.window) }
+ pub fn SetInterfaceAttribute(&self, _: &JS<Blob>) {}
pub fn GetBooleanAttributeNullable(&self) -> Option<bool> { Some(false) }
pub fn SetBooleanAttributeNullable(&self, _: Option<bool>) {}
@@ -60,6 +66,8 @@ impl TestBinding {
pub fn SetDoubleAttributeNullable(&self, _: Option<f64>) {}
pub fn GetStringAttributeNullable(&self) -> Option<DOMString> { Some(~"") }
pub fn SetStringAttributeNullable(&self, _: Option<DOMString>) {}
+ pub fn GetInterfaceAttributeNullable(&self) -> Option<JS<Blob>> { Some(Blob::new(&self.window)) }
+ pub fn SetInterfaceAttributeNullable(&self, _: Option<JS<Blob>>) {}
// FIXME (issue #1813) Doesn't currently compile.
// pub fn PassOptionalBoolean(&self, _: Option<bool>) {}
@@ -74,6 +82,7 @@ impl TestBinding {
// pub fn PassOptionalFloat(&self, _: Option<f32>) {}
// pub fn PassOptionalDouble(&self, _: Option<f64>) {}
pub fn PassOptionalString(&self, _: Option<DOMString>) {}
+ pub fn PassOptionalInterface(&self, _: Option<JS<Blob>>) {}
// pub fn PassOptionalNullableBoolean(&self, _: Option<Option<bool>>) {}
// pub fn PassOptionalNullableByte(&self, _: Option<Option<i8>>) {}
@@ -87,6 +96,7 @@ impl TestBinding {
// pub fn PassOptionalNullableFloat(&self, _: Option<Option<f32>>) {}
// pub fn PassOptionalNullableDouble(&self, _: Option<Option<f64>>) {}
pub fn PassOptionalNullableString(&self, _: Option<Option<DOMString>>) {}
+ // pub fn PassOptionalNullableInterface(&self, _: Option<Option<JS<Blob>>>) {}
pub fn PassOptionalBooleanWithDefault(&self, _: bool) {}
pub fn PassOptionalByteWithDefault(&self, _: i8) {}
@@ -111,6 +121,7 @@ impl TestBinding {
pub fn PassOptionalNullableFloatWithDefault(&self, _: Option<f32>) {}
pub fn PassOptionalNullableDoubleWithDefault(&self, _: Option<f64>) {}
// pub fn PassOptionalNullableStringWithDefault(&self, _: Option<DOMString>) {}
+ pub fn PassOptionalNullableInterfaceWithDefault(&self, _: Option<JS<Blob>>) {}
}
impl Reflectable for TestBinding {