From b5d891ed6a05edbaf2dd9c5b785c22785c914fba Mon Sep 17 00:00:00 2001 From: serenitydev Date: Mon, 14 Feb 2022 16:45:55 -0500 Subject: [PATCH] Base+LibWeb: Add test case for Workers on welcome homepage --- Base/res/html/misc/welcome.html | 1 + Base/res/html/misc/worker.js | 10 ++++++++ Base/res/html/misc/worker_parent.html | 33 +++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 Base/res/html/misc/worker.js create mode 100644 Base/res/html/misc/worker_parent.html diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html index 4699e3a58a..e4518ad0eb 100644 --- a/Base/res/html/misc/welcome.html +++ b/Base/res/html/misc/welcome.html @@ -152,6 +152,7 @@
  • window.location property
  • Test for the early return steps 6-8 of the "prepare a script" algorithm
  • Basic test for async functions and their integration with the LibWeb event loop
  • +
  • Workers
  • Canvas

  • canvas 2D test
  • canvas rotate()
  • diff --git a/Base/res/html/misc/worker.js b/Base/res/html/misc/worker.js new file mode 100644 index 0000000000..25f1ef34e0 --- /dev/null +++ b/Base/res/html/misc/worker.js @@ -0,0 +1,10 @@ +onmessage = evt => { + console.log("In Worker - Got message:", JSON.stringify(evt.data)); + + postMessage(JSON.stringify(evt.data)); +}; + +console.log("In Worker - Loaded", this); +console.log("Keys: ", JSON.stringify(Object.keys(this))); + +postMessage("loaded"); diff --git a/Base/res/html/misc/worker_parent.html b/Base/res/html/misc/worker_parent.html new file mode 100644 index 0000000000..987d46a19a --- /dev/null +++ b/Base/res/html/misc/worker_parent.html @@ -0,0 +1,33 @@ + + + + + Worker + + +

    Worker Test

    +
    + + + + +