function testAbortedFetch() { var ac = new AbortController();
ac.abort();
fetch("slow.sjs", { signal: ac.signal }).then(() => {
ok(false, "Fetch should not return a resolved promise");
}, e => {
is(e.name, "AbortError", "We have an abort error");
}).then(next);
}
function testFetchAndAbort() { var ac = new AbortController();
p.then(() => {
ok(false, "Fetch should not return a resolved promise");
}, e => {
is(e.name, "AbortError", "We have an abort error");
}).then(next);
}
function testWorkerAbortedFetch() { var w = new Worker("worker_abort_controller_fetch.js");
w.onmessage = function(e) {
ok(e.data, "Abort + Fetch works in workers");
next();
};
w.postMessage("testWorkerAbortedFetch");
}
function testWorkerFetchAndAbort() { var w = new Worker("worker_abort_controller_fetch.js");
w.onmessage = function(e) {
ok(e.data, "Abort + Fetch works in workers");
next();
};
w.postMessage("testWorkerFetchAndAbort");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.