Skip to content

Commit

Permalink
Bug 1623977 [wpt PR 22363] - WebAudio/OrientationSensor/Portals: use …
Browse files Browse the repository at this point in the history
…Wasm to get a SharedArrayBuff…, a=testonly

Automatic update from web-platform-tests
Audio/Orientation/Portals: use Wasm to get a SharedArrayBuffer instance

For web-platform-tests/wpt#22358.
--

wpt-commits: a9b173567826e62591410560abbef047b534f01d
wpt-pr: 22363
  • Loading branch information
annevk authored and moz-wptsync-bot committed Mar 31, 2020
1 parent 59ec6ca commit f03acd3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
3 changes: 2 additions & 1 deletion testing/web-platform/tests/portals/portal-activate-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f03acd3

Please sign in to comment.