blob: 6b008fea8e7e731fff50823f6e50ba3a0404a5b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
function testWorkerAbortedFetch() {
var fc = new FetchController();
fc.abort();
fetch('slow.sjs', { signal: fc.signal }).then(() => {
postMessage(false);
}, e => {
postMessage(e.name == "AbortError");
});
}
function testWorkerFetchAndAbort() {
var fc = new FetchController();
var p = fetch('slow.sjs', { signal: fc.signal });
fc.abort();
p.then(() => {
postMessage(false);
}, e => {
postMessage(e.name == "AbortError");
});
}
onmessage = function(e) {
self[e.data]();
}
|