mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Create meaningful tests for native promise handlers.
This commit is contained in:
parent
57b3ccd38c
commit
ae81ab3972
3 changed files with 23 additions and 6 deletions
|
@ -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>>,
|
||||
|
|
|
@ -516,6 +516,8 @@ interface TestBinding {
|
|||
void acceptPromise(Promise<DOMString> string);
|
||||
void acceptNullablePromise(Promise<DOMString>? string);
|
||||
Promise<any> promiseNativeHandler(SimpleCallback? resolve, SimpleCallback? reject);
|
||||
void promiseResolveNative(Promise<any> p, any value);
|
||||
void promiseRejectNative(Promise<any> p, any value);
|
||||
|
||||
void panic();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue