Create meaningful tests for native promise handlers.

This commit is contained in:
Josh Matthews 2016-09-05 11:53:06 -04:00
parent 57b3ccd38c
commit ae81ab3972
3 changed files with 23 additions and 6 deletions

View file

@ -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>>,