aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-06-21 19:35:36 -0400
committerJosh Matthews <josh@joshmatthews.net>2016-09-22 16:16:48 -0400
commita1091772ec9258d4e2c4184e07edab730e4d559c (patch)
treef9a92d79c1d844a288f64c20260dabe5675047a5 /components/script/dom/testbinding.rs
parent73b296350927bad6d526cce21434ce68a75216fa (diff)
downloadservo-a1091772ec9258d4e2c4184e07edab730e4d559c.tar.gz
servo-a1091772ec9258d4e2c4184e07edab730e4d559c.zip
Implement binding support for returning and accepting Promises in WebIDL.
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r--components/script/dom/testbinding.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs
index 566ff2d9375..3ac2e7c2c26 100644
--- a/components/script/dom/testbinding.rs
+++ b/components/script/dom/testbinding.rs
@@ -28,6 +28,7 @@ use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::str::{ByteString, DOMString, USVString};
use dom::bindings::weakref::MutableWeakRef;
use dom::blob::{Blob, BlobImpl};
+use dom::promise::Promise;
use dom::url::URL;
use js::jsapi::{HandleObject, HandleValue, JSContext, JSObject};
use js::jsapi::{JS_NewPlainObject, JS_NewUint8ClampedArray};
@@ -647,6 +648,22 @@ impl TestBindingMethods for TestBinding {
fn ReceiveMozMapOfMozMaps(&self) -> MozMap<MozMap<i32>> { MozMap::new() }
fn ReceiveAnyMozMap(&self) -> MozMap<JSVal> { MozMap::new() }
+ #[allow(unrooted_must_root)]
+ fn ReturnPromise(&self) -> Rc<Promise> {
+ Promise::new(self.global().r())
+ }
+
+ #[allow(unrooted_must_root)]
+ fn PromiseAttribute(&self) -> Rc<Promise> {
+ Promise::new(self.global().r())
+ }
+
+ fn AcceptPromise(&self, _promise: &Promise) {
+ }
+
+ fn AcceptNullablePromise(&self, _promise: Option<&Promise>) {
+ }
+
fn PassSequenceSequence(&self, _seq: Vec<Vec<i32>>) {}
fn ReturnSequenceSequence(&self) -> Vec<Vec<i32>> { vec![] }
fn PassUnionSequenceSequence(&self, seq: LongOrLongSequenceSequence) {