summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/workers
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /testing/web-platform/tests/workers
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/workers')
-rw-r--r--testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html18
-rw-r--r--testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html.headers2
-rw-r--r--testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html20
-rw-r--r--testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html.headers2
-rw-r--r--testing/web-platform/tests/workers/modules/WEB_FEATURES.yml7
-rw-r--r--testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js1
-rw-r--r--testing/web-platform/tests/workers/semantics/interface-objects/003.any.js1
-rw-r--r--testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js3
-rw-r--r--testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js.headers1
-rw-r--r--testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js7
-rw-r--r--testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js.headers1
11 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html b/testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html
new file mode 100644
index 0000000000..887d95f3df
--- /dev/null
+++ b/testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<title>Test that creation of a "new Worker()" will occur in parallel to the main JS thread performing other computation, and can be joined with.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(t => {
+ return new Promise(resolve => {
+ let worker = new Worker("support/Worker-creation-happens-in-parallel.js");
+ let sab = new Uint8Array(new SharedArrayBuffer(16));
+ window.sab = sab;
+ worker.postMessage(sab);
+ let end = performance.now() + 10*1000;
+ while(sab[0] != 1 && performance.now() < end) /*wait to join with the result*/;
+ assert_true(sab[0] == 1);
+ resolve();
+ });
+}, 'Tests that creation of a "new Worker()" will occur in parallel');
+</script>
diff --git a/testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html.headers b/testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html.headers
new file mode 100644
index 0000000000..4b06ac7cc6
--- /dev/null
+++ b/testing/web-platform/tests/workers/Worker-creation-happens-in-parallel.https.html.headers
@@ -0,0 +1,2 @@
+Cross-Origin-Opener-Policy:same-origin
+Cross-Origin-Embedder-Policy:require-corp
diff --git a/testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html b/testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html
new file mode 100644
index 0000000000..3b8683f79d
--- /dev/null
+++ b/testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<title>Test that calling "worker.postMessage()" will occur truly in parallel to the main JS thread performing other computation.</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script>
+promise_test(t => {
+ return new Promise(resolve => {
+ let worker = new Worker("support/Worker-postMessage-happens-in-parallel.js");
+ worker.postMessage('init');
+ worker.onmessage = () => {
+ let sab = new Uint8Array(new SharedArrayBuffer(16));
+ worker.postMessage(sab);
+ let end = performance.now() + 30*1000;
+ while(sab[0] != 1 && performance.now() < end) /*wait to join with the result*/;
+ assert_true(sab[0] == 1);
+ resolve();
+ };
+ });
+}, 'Tests that calling "worker.postMessage()" will occur truly in parallel to the main JS thread');
+</script>
diff --git a/testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html.headers b/testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html.headers
new file mode 100644
index 0000000000..4b06ac7cc6
--- /dev/null
+++ b/testing/web-platform/tests/workers/Worker-postMessage-happens-in-parallel.https.html.headers
@@ -0,0 +1,2 @@
+Cross-Origin-Opener-Policy:same-origin
+Cross-Origin-Embedder-Policy:require-corp
diff --git a/testing/web-platform/tests/workers/modules/WEB_FEATURES.yml b/testing/web-platform/tests/workers/modules/WEB_FEATURES.yml
new file mode 100644
index 0000000000..ab73efc0d0
--- /dev/null
+++ b/testing/web-platform/tests/workers/modules/WEB_FEATURES.yml
@@ -0,0 +1,7 @@
+features:
+- name: js-modules-workers
+ files:
+ - dedicated-worker-*
+- name: js-modules-shared-workers
+ files:
+ - shared-worker-*
diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js
index 873e8701bb..a95da5638f 100644
--- a/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js
+++ b/testing/web-platform/tests/workers/semantics/interface-objects/001.worker.js
@@ -30,6 +30,7 @@ var expected = [
"Uint16Array",
"Int32Array",
"Uint32Array",
+ "Float16Array",
"Float32Array",
"Float64Array",
"DataView",
diff --git a/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js b/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js
index 974756c508..9dcc024ab7 100644
--- a/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js
+++ b/testing/web-platform/tests/workers/semantics/interface-objects/003.any.js
@@ -30,6 +30,7 @@ var expected = [
"Uint16Array",
"Int32Array",
"Uint32Array",
+ "Float16Array",
"Float32Array",
"Float64Array",
"DataView",
diff --git a/testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js b/testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js
new file mode 100644
index 0000000000..1e68302a0f
--- /dev/null
+++ b/testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js
@@ -0,0 +1,3 @@
+onmessage = (e) => {
+ e.data[0] = 1;
+}
diff --git a/testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js.headers b/testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js.headers
new file mode 100644
index 0000000000..8249c49c34
--- /dev/null
+++ b/testing/web-platform/tests/workers/support/Worker-creation-happens-in-parallel.js.headers
@@ -0,0 +1 @@
+Cross-Origin-Embedder-Policy:require-corp
diff --git a/testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js b/testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js
new file mode 100644
index 0000000000..48b4c34fe3
--- /dev/null
+++ b/testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js
@@ -0,0 +1,7 @@
+onmessage = (e) => {
+ if (e.data == 'init') {
+ postMessage(0);
+ } else {
+ e.data[0] = 1;
+ }
+}
diff --git a/testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js.headers b/testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js.headers
new file mode 100644
index 0000000000..8249c49c34
--- /dev/null
+++ b/testing/web-platform/tests/workers/support/Worker-postMessage-happens-in-parallel.js.headers
@@ -0,0 +1 @@
+Cross-Origin-Embedder-Policy:require-corp