mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Handle abort signal in CloseWatcher
This commit is contained in:
committed by
Tim Ledbetter
parent
156f9fff32
commit
e27c59047a
Notes:
github-actions[bot]
2024-12-07 12:07:43 +00:00
Author: https://github.com/FMMazur 🔰 Commit: https://github.com/LadybirdBrowser/ladybird/commit/e27c59047a0 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2722 Reviewed-by: https://github.com/tcl3 ✅
18
Tests/LibWeb/Text/input/CloseWatcher-fire-once.html
Normal file
18
Tests/LibWeb/Text/input/CloseWatcher-fire-once.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let controller = new AbortController();
|
||||
let watcher = new CloseWatcher({ signal: controller.signal });
|
||||
let oncancel_call_count_ = 0;
|
||||
let onclose_call_count_ = 0;
|
||||
watcher.oncancel = () => oncancel_call_count_++;
|
||||
watcher.onclose = () => onclose_call_count_++;
|
||||
|
||||
watcher.requestClose();
|
||||
controller.abort();
|
||||
|
||||
println(oncancel_call_count_);
|
||||
println(onclose_call_count_);
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user