Skip to content

Commit

Permalink
test: update WPT abort tests
Browse files Browse the repository at this point in the history
PR-URL: #39697
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
targos authored and danielleadams committed Aug 16, 2021
1 parent 94381fb commit 7e98845
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Last update:

- common: https://github.com/web-platform-tests/wpt/tree/03c5072aff/common
- console: https://github.com/web-platform-tests/wpt/tree/3b1f72e99a/console
- dom/abort: https://github.com/web-platform-tests/wpt/tree/1728d198c9/dom/abort
- dom/abort: https://github.com/web-platform-tests/wpt/tree/c49cafb491/dom/abort
- encoding: https://github.com/web-platform-tests/wpt/tree/35f70910d3/encoding
- FileAPI: https://github.com/web-platform-tests/wpt/tree/3b279420d4/FileAPI
- hr-time: https://github.com/web-platform-tests/wpt/tree/9910784394/hr-time
Expand Down
12 changes: 12 additions & 0 deletions test/fixtures/wpt/dom/abort/AbortSignal.any.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test(t => {
const signal = AbortSignal.abort();
assert_true(signal instanceof AbortSignal, "returned object is an AbortSignal");
assert_true(signal.aborted, "returned signal is already aborted");
}, "the AbortSignal.abort() static returns an already aborted signal");

async_test(t => {
const s = AbortSignal.abort();
s.addEventListener("abort", t.unreached_func("abort event listener called"));
s.onabort = t.unreached_func("abort event handler called");
t.step_timeout(() => { t.done(); }, 2000);
}, "signal returned by AbortSignal.abort() should not fire abort event");
5 changes: 0 additions & 5 deletions test/fixtures/wpt/dom/abort/event.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,4 @@ test(t => {
controller.abort();
}, "the abort event should have the right properties");

test(t => {
const signal = AbortSignal.abort();
assert_true(signal.aborted);
}, "the AbortSignal.abort() static returns an already aborted signal");

done();
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"path": "console"
},
"dom/abort": {
"commit": "1728d198c92834d92f7f399ef35e7823d5bfa0e4",
"commit": "c49cafb491d99d6318f8f24a26936cc66501f412",
"path": "dom/abort"
},
"encoding": {
Expand Down

0 comments on commit 7e98845

Please sign in to comment.