aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-03-04 16:28:34 +0100
committerMs2ger <ms2ger@gmail.com>2014-03-04 16:28:34 +0100
commit4166ff479447a85aa5e19cd471e2cf85b2f513ce (patch)
tree70a813cec37665bcf6929e88ca3fb7f99230f96b /src/components/script/dom/testbinding.rs
parent4a6077ca4cb6e2d54e2f558c18f45849c9d3c47d (diff)
downloadservo-4166ff479447a85aa5e19cd471e2cf85b2f513ce.tar.gz
servo-4166ff479447a85aa5e19cd471e2cf85b2f513ce.zip
Introduce a test IDL file.
Diffstat (limited to 'src/components/script/dom/testbinding.rs')
-rw-r--r--src/components/script/dom/testbinding.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/components/script/dom/testbinding.rs b/src/components/script/dom/testbinding.rs
new file mode 100644
index 00000000000..c19b41fa303
--- /dev/null
+++ b/src/components/script/dom/testbinding.rs
@@ -0,0 +1,42 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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::utils::{Reflector, Reflectable};
+
+#[deriving(Encodable)]
+pub struct TestBinding {
+ reflector: Reflector,
+}
+
+impl TestBinding {
+ pub fn BooleanAttribute(&self) -> bool { false }
+ pub fn SetBooleanAttribute(&self, _: bool) {}
+ pub fn ByteAttribute(&self) -> i8 { 0 }
+ pub fn OctetAttribute(&self) -> u8 { 0 }
+ pub fn ShortAttribute(&self) -> i16 { 0 }
+ pub fn UnsignedShortAttribute(&self) -> u16 { 0 }
+ pub fn SetUnsignedShortAttribute(&self, _: u16) {}
+ pub fn LongAttribute(&self) -> i32 { 0 }
+ pub fn SetLongAttribute(&self, _: i32) {}
+ pub fn UnsignedLongAttribute(&self) -> u32 { 0 }
+ pub fn SetUnsignedLongAttribute(&self, _: u32) {}
+ pub fn LongLongAttribute(&self) -> i64 { 0 }
+ pub fn SetLongLongAttribute(&self, _: i64) {}
+ pub fn UnsignedLongLongAttribute(&self) -> u64 { 0 }
+ pub fn SetUnsignedLongLongAttribute(&self, _: u64) {}
+ pub fn FloatAttribute(&self) -> f32 { 0. }
+ pub fn SetFloatAttribute(&self, _: f32) {}
+ pub fn DoubleAttribute(&self) -> f64 { 0. }
+ pub fn SetDoubleAttribute(&self, _: f64) {}
+}
+
+impl Reflectable for TestBinding {
+ fn reflector<'a>(&'a self) -> &'a Reflector {
+ &self.reflector
+ }
+
+ fn mut_reflector<'a>(&'a mut self) -> &'a mut Reflector {
+ &mut self.reflector
+ }
+}