mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Add interface codegen tests.
This commit is contained in:
parent
48ebd2a5e3
commit
9fe72eb379
2 changed files with 16 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue