diff options
author | Josh Matthews <josh@joshmatthews.net> | 2016-09-05 11:53:06 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-09-22 16:16:56 -0400 |
commit | ae81ab3972b0a4064046dce8d0c37a2a375fe385 (patch) | |
tree | 6cef57fc742cdd9642e65a56b794960e7ba8773b /components/script/dom/testbinding.rs | |
parent | 57b3ccd38cbdf53b8e45f68e8ff6c4fd786118dc (diff) | |
download | servo-ae81ab3972b0a4064046dce8d0c37a2a375fe385.tar.gz servo-ae81ab3972b0a4064046dce8d0c37a2a375fe385.zip |
Create meaningful tests for native promise handlers.
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r-- | components/script/dom/testbinding.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 26a79a029ff..c318badc1ba 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -660,6 +660,14 @@ impl TestBindingMethods for TestBinding { Promise::Reject(self.global().r(), cx, v) } + fn PromiseResolveNative(&self, cx: *mut JSContext, p: &Promise, v: HandleValue) { + p.maybe_resolve(cx, v); + } + + fn PromiseRejectNative(&self, cx: *mut JSContext, p: &Promise, v: HandleValue) { + p.maybe_reject(cx, v); + } + #[allow(unrooted_must_root)] fn PromiseNativeHandler(&self, resolve: Option<Rc<SimpleCallback>>, |