mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
Tests: Add test for loading module scripts in Workers
This commit is contained in:
parent
f67bc591a0
commit
f9f98016e2
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