Add a simple API to reject promises with DOM error values.

This commit is contained in:
Josh Matthews 2016-09-06 19:58:26 -04:00
parent ae81ab3972
commit 27d44c8d10
5 changed files with 35 additions and 2 deletions

View file

@ -21,6 +21,13 @@
});
}, 'Reject callback gets argument');
promise_test(function(test) {
var t = new TestBinding;
var p = new Promise(function() {});
t.promiseRejectWithTypeError(p, "success");
return promise_rejects(test, new TypeError("success"), p, "TypeError should be instantiated");
}, 'Native code rejects with exception');
promise_test(function(test) {
var t = new TestBinding;
var resolved;