diff --git a/testing/web-platform/tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html b/testing/web-platform/tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html index aec1b858542b..2fc545d5acb6 100644 --- a/testing/web-platform/tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html +++ b/testing/web-platform/tests/html/cross-origin-embedder-policy/cross-origin-isolated-permission.https.html @@ -3,24 +3,28 @@ + + diff --git a/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/cross-origin-isolated-worker.js b/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/cross-origin-isolated-worker.js new file mode 100644 index 000000000000..9f1e3710af6e --- /dev/null +++ b/testing/web-platform/tests/html/cross-origin-embedder-policy/resources/cross-origin-isolated-worker.js @@ -0,0 +1,11 @@ +// For DedicatedWorker and ServiceWorker +self.addEventListener('message', (e) => { + e.data.port.postMessage(self.crossOriginIsolated); +}); + +// For SharedWorker +self.addEventListener('connect', (e) => { + e.ports[0].onmessage = (ev) => { + ev.data.port.postMessage(self.crossOriginIsolated); + }; +}); \ No newline at end of file diff --git a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html index dbc73e98f578..bfcc8b61ca23 100644 --- a/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html +++ b/testing/web-platform/tests/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/blob-data.https.html @@ -50,14 +50,14 @@ `; } -function propertyTests(name) { +function propertyTests(name, crossOriginIsolated) { return ` test(() => { assert_equals(self.origin, self.location.origin); }, "${name}: self.origin"); test(() => { - assert_true(self.crossOriginIsolated); + assert_equals(self.crossOriginIsolated, ${crossOriginIsolated}); }, "${name}: self.crossOriginIsolated"); test(() => { @@ -74,7 +74,7 @@ ${blobWorkerIncrementerTest("blob worker", self.location.origin)} -${propertyTests("blob worker")} +${propertyTests("blob worker", true)} done(); `; @@ -90,7 +90,7 @@ ${blobWorkerIncrementerTest("blob frame", self.location.origin)} -${propertyTests("blob frame")} +${propertyTests("blob frame", true)} <\/script> `; @@ -106,7 +106,7 @@ ${blobWorkerIncrementerTest("data worker")} -${propertyTests("data worker")} +${propertyTests("data worker", false)} done(); `; @@ -121,7 +121,7 @@ ${blobWorkerIncrementerTest("data frame")} -${propertyTests("data frame")} +${propertyTests("data frame", true)} <\/script> `;