diff --git a/testing/web-platform/tests/orientation-sensor/orientation-sensor-tests.js b/testing/web-platform/tests/orientation-sensor/orientation-sensor-tests.js index a745bc885315..14023490a06f 100644 --- a/testing/web-platform/tests/orientation-sensor/orientation-sensor-tests.js +++ b/testing/web-platform/tests/orientation-sensor/orientation-sensor-tests.js @@ -42,7 +42,9 @@ async function checkPopulateMatrix(t, sensorProvider, sensorType) { assert_throws_js(TypeError, - () => sensor.populateMatrix(new Float32Array(new SharedArrayBuffer(16)))); + + + () => sensor.populateMatrix(new Float32Array(new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer))); sensor.start(); diff --git a/testing/web-platform/tests/portals/portal-activate-data.html b/testing/web-platform/tests/portals/portal-activate-data.html index 004fa97e55c0..260bb00ff068 100644 --- a/testing/web-platform/tests/portals/portal-activate-data.html +++ b/testing/web-platform/tests/portals/portal-activate-data.html @@ -74,7 +74,8 @@ const w = await openBlankPortalHost(); await promise_rejects_dom( t, 'DataCloneError', w.DOMException, - openPortalAndActivate('', {data: new SharedArrayBuffer}, w)); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + openPortalAndActivate('', {data: new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer}, w)); }, "A SharedArrayBuffer cannot be passed through activate data."); promise_test(async t => { diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html index 20780d94b730..c0cd49d32520 100644 --- a/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html +++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html @@ -149,7 +149,9 @@ buffer.copyFromChannel(x, 3); }, '7: buffer.copyFromChannel(x, 3)').throw(DOMException, 'IndexSizeError'); - let shared_buffer = new Float32Array(new SharedArrayBuffer(32)); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + // WebAssembly.Memory's size is in multiples of 64 KiB + const shared_buffer = new Float32Array(new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer); should( () => { buffer.copyFromChannel(shared_buffer, 0); @@ -202,7 +204,9 @@ buffer.copyToChannel(x, 3); }, '6: buffer.copyToChannel(x, 3)').throw(DOMException, 'IndexSizeError'); - let shared_buffer = new Float32Array(new SharedArrayBuffer(32)); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + // WebAssembly.Memory's size is in multiples of 64 KiB + const shared_buffer = new Float32Array(new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer); should( () => { buffer.copyToChannel(shared_buffer, 0);