mirror of
https://github.com/servo/servo.git
synced 2025-08-20 12:55:33 +01:00
Update web-platform-tests to revision b'bcf4a27c0a9dbb07d974a880acb26eb289a85c7e'
This commit is contained in:
parent
293c8623fa
commit
61b963c73e
183 changed files with 3880 additions and 1012 deletions
|
@ -516,6 +516,24 @@ complex cleanup behavior should manage execution order explicitly. If
|
|||
any of the eventual values are rejected, the test runner will report
|
||||
an error.
|
||||
|
||||
### AbortSignal support ###
|
||||
|
||||
[`Test.get_signal`](#Test.get_signal) gives an AbortSignal that is aborted when
|
||||
the test finishes. This can be useful when dealing with AbortSignal-supported
|
||||
APIs.
|
||||
|
||||
```js
|
||||
promise_test(t => {
|
||||
// Throws when the user agent does not support AbortSignal
|
||||
const signal = t.get_signal();
|
||||
const event = await new Promise(resolve => {
|
||||
document.body.addEventListener(resolve, { once: true, signal });
|
||||
document.body.click();
|
||||
});
|
||||
assert_equals(event.type, "click");
|
||||
}, "");
|
||||
```
|
||||
|
||||
## Timers in Tests ##
|
||||
|
||||
In general the use of timers (i.e. `setTimeout`) in tests is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue