mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Support an equivalent of Trusted<T> for Rc<Promise> objects named TrustedPromise.
This commit is contained in:
parent
27d44c8d10
commit
498ccd41e8
7 changed files with 145 additions and 10 deletions
|
@ -51,4 +51,17 @@
|
|||
assert_equals(rejected, 'success')
|
||||
});
|
||||
}, 'Native reject callback gets argument');
|
||||
|
||||
promise_test(function(test) {
|
||||
var t = new TestBinding;
|
||||
var resolved;
|
||||
var p = new Promise(function() {});
|
||||
var start = Date.now();
|
||||
t.resolvePromiseDelayed(p, 'success', 100);
|
||||
return p.then(function(v) {
|
||||
var end = Date.now();
|
||||
assert_true(end - start > 100);
|
||||
assert_equals(v, 'success');
|
||||
});
|
||||
}, 'Native promise from async callback can be resolved');
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue