mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
LibWeb: Implement FetchController::abort()
This commit is contained in:
parent
4c5019f89c
commit
968c38e54f
Notes:
github-actions[bot]
2024-11-24 10:12:37 +00:00
Author: https://github.com/kennethmyhra
Commit: 968c38e54f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2532
4 changed files with 34 additions and 4 deletions
20
Tests/LibWeb/Text/input/Fetch/fetch-controller-abort.html
Normal file
20
Tests/LibWeb/Text/input/Fetch/fetch-controller-abort.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const runAbortController = ((reason) => {
|
||||
let controller = new AbortController();
|
||||
let signal = controller.signal;
|
||||
|
||||
fetch('data:text/plain,fetched from far', { signal })
|
||||
.catch(err => {
|
||||
println(err);
|
||||
});
|
||||
|
||||
controller.abort(reason);
|
||||
});
|
||||
|
||||
runAbortController(undefined);
|
||||
runAbortController("Abort with a reason");
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue