Skip to content

Commit

Permalink
Baldr: correctly propagate AbortError from consume stream body operat…
Browse files Browse the repository at this point in the history
…ion ()

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1505632
gecko-commit: a7812eefff9559ee40e9f0a8e6c812ea9d36f06d
gecko-integration-branch: central
gecko-reviewers: lth, baku, Ms2ger
  • Loading branch information
Luke Wagner authored and moz-wptsync-bot committed Nov 16, 2018
1 parent b8ac03b commit ec0619b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wasm/webapi/abort.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ for (const method of methods) {
controller.abort();
return promise_rejects(t, 'AbortError', promise, `${method} should reject`);
}, `${method}() synchronously followed by abort should reject with AbortError`);

promise_test(async t => {
const controller = new AbortController();
const signal = controller.signal;
return fetch('../incrementer.wasm', { signal })
.then(response => {
Promise.resolve().then(() => controller.abort());
return WebAssembly[method](response);
})
.catch(err => {
assert_true(err.name === "AbortError");
});
}, `${method}() asynchronously racing with abort should succeed or reject with AbortError`);
}

0 comments on commit ec0619b

Please sign in to comment.