From f03acd3f746af444bca1d89c65c3995244649db3 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 27 Mar 2020 20:43:09 +0000 Subject: [PATCH] =?UTF-8?q?Bug=201623977=20[wpt=20PR=2022363]=20-=20WebAud?= =?UTF-8?q?io/OrientationSensor/Portals:=20use=20Wasm=20to=20get=20a=20Sha?= =?UTF-8?q?redArrayBuff=E2=80=A6,=20a=3Dtestonly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests Audio/Orientation/Portals: use Wasm to get a SharedArrayBuffer instance For https://github.com/web-platform-tests/wpt/issues/22358. -- wpt-commits: a9b173567826e62591410560abbef047b534f01d wpt-pr: 22363 --- .../tests/orientation-sensor/orientation-sensor-tests.js | 4 +++- .../web-platform/tests/portals/portal-activate-data.html | 3 ++- .../audiobuffer-copy-channel.html | 8 ++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) 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 5d35f3b9afcc5..9d44d63870526 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) { // Throws if passed SharedArrayBuffer view. assert_throws_js(TypeError, - () => sensor.populateMatrix(new Float32Array(new SharedArrayBuffer(16)))); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + // WebAssembly.Memory's size is in multiples of 64 KiB + () => 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 004fa97e55c05..260bb00ff0686 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 20780d94b730a..c0cd49d32520f 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);