mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 18:28:57 +00:00
Tests: Add test for loading module scripts in Workers
This commit is contained in:
parent
f67bc591a0
commit
f9f98016e2
Notes:
sideshowbarker
2024-07-17 07:11:12 +09:00
Author: https://github.com/ADKaster
Commit: f9f98016e2
Pull-request: https://github.com/SerenityOS/serenity/pull/23476
3 changed files with 22 additions and 0 deletions
18
Tests/LibWeb/Text/input/Worker/Worker-module.html
Normal file
18
Tests/LibWeb/Text/input/Worker/Worker-module.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest((done) => {
|
||||
let work = new Worker('worker.mjs', { type: 'module' });
|
||||
work.onmessage = (e) => {
|
||||
println(`Message from worker: ${e.data}`);
|
||||
work.onmessage = null;
|
||||
work.terminate();
|
||||
done();
|
||||
};
|
||||
|
||||
work.onerror = (e) => {
|
||||
println(`Worker error: ${e.message}`);
|
||||
};
|
||||
|
||||
work.postMessage('Hello :^)');
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue