ladybird/Tests/LibWeb/Text/input/Worker/Worker-close-after-postMessage.html
Tim Ledbetter fd8d350b47 LibWeb: Don't discard PostedMessage tasks when closing a worker
The spec expects `postMessage()` to act as if it is invoked
immediately. Since `postMessage()` isn't actually invoked immediately,
keep tasks with source `PostedMessage` in the task queue, so that these
tasks are processed. Fixes a hang when `WorkerGlobalScope.close()` is
called immediately after `postMessage()`.
2024-10-08 06:51:04 +02:00

12 lines
300 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(done => {
let work = new Worker("worker-close-after-postMessage.js");
work.onmessage = (evt) => {
println(evt.data);
done();
};
work.postMessage("")
});
</script>