Skip to content

Commit

Permalink
Run structuredClone tests in ShadowRealms
Browse files Browse the repository at this point in the history
Run the "structuredClone battery of tests" in the various ShadowRealm
environments. This includes making sure the various harness exports are
added as global properties.
  • Loading branch information
ptomato committed Nov 20, 2024
1 parent 840795d commit 8a4d6ef
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/sab.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const createBuffer = (() => {
globalThis.createBuffer = (() => {
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()`
let sabConstructor;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ function runStructuredCloneBatteryOfTests(runner) {
});
Promise.all(allTests).then(_ => runner.teardown());
}
globalThis.runStructuredCloneBatteryOfTests = runStructuredCloneBatteryOfTests;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* This file is mostly a remix of @zcorpan’s web worker test suite */

structuredCloneBatteryOfTests = [];
globalThis.structuredCloneBatteryOfTests = [];

function check(description, input, callback, requiresDocument = false, requiresBlob = false) {
structuredCloneBatteryOfTests.push({
Expand Down
1 change: 1 addition & 0 deletions html/webappapis/structured-clone/structured-clone.any.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// META: title=structuredClone() tests
// META: global=window,dedicatedworker,shadowrealm
// META: script=/common/sab.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests.js
// META: script=/html/webappapis/structured-clone/structured-clone-battery-of-tests-with-transferables.js
Expand Down

0 comments on commit 8a4d6ef

Please sign in to comment.