diff --git a/testing/web-platform/tests/compression/compression-bad-chunks.tentative.any.js b/testing/web-platform/tests/compression/compression-bad-chunks.tentative.any.js index cc71b00030921..af210a765a7ea 100644 --- a/testing/web-platform/tests/compression/compression-bad-chunks.tentative.any.js +++ b/testing/web-platform/tests/compression/compression-bad-chunks.tentative.any.js @@ -28,13 +28,15 @@ const badChunks = [ // Use a getter to postpone construction so that all tests don't fail where // SharedArrayBuffer is not yet implemented. get value() { - return new SharedArrayBuffer(); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + return new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; } }, { name: 'shared Uint8Array', get value() { - return new Uint8Array(new SharedArrayBuffer()) + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + return new Uint8Array(new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer) } }, ]; diff --git a/testing/web-platform/tests/compression/decompression-bad-chunks.tentative.any.js b/testing/web-platform/tests/compression/decompression-bad-chunks.tentative.any.js index 51f369311588d..7dcb717a45cf0 100644 --- a/testing/web-platform/tests/compression/decompression-bad-chunks.tentative.any.js +++ b/testing/web-platform/tests/compression/decompression-bad-chunks.tentative.any.js @@ -28,13 +28,15 @@ const badChunks = [ // Use a getter to postpone construction so that all tests don't fail where // SharedArrayBuffer is not yet implemented. get value() { - return new SharedArrayBuffer(); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + return new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; } }, { name: 'shared Uint8Array', get value() { - return new Uint8Array(new SharedArrayBuffer()) + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + return new Uint8Array(new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer) } }, { diff --git a/testing/web-platform/tests/css/css-layout-api/constraints-data-sab-failure.https.html b/testing/web-platform/tests/css/css-layout-api/constraints-data-sab-failure.https.html index 8659c2edef56a..b8df61c73d305 100644 --- a/testing/web-platform/tests/css/css-layout-api/constraints-data-sab-failure.https.html +++ b/testing/web-platform/tests/css/css-layout-api/constraints-data-sab-failure.https.html @@ -35,7 +35,8 @@ try { childFragment = await child.layoutNextFragment({ - data: { sab: new SharedArrayBuffer(4) } + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + data: { sab: new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer } }); } catch(e) { // Success! The structured cloning algorithm should have thrown an error. diff --git a/testing/web-platform/tests/css/css-layout-api/fragment-data-sab-failure.https.html b/testing/web-platform/tests/css/css-layout-api/fragment-data-sab-failure.https.html index a6cfcf663dcf3..681de5b543c29 100644 --- a/testing/web-platform/tests/css/css-layout-api/fragment-data-sab-failure.https.html +++ b/testing/web-platform/tests/css/css-layout-api/fragment-data-sab-failure.https.html @@ -33,7 +33,8 @@ async layout(children, edges, constraints, styleMap) { const childFragments = await Promise.all(children.map(child => child.layoutNextFragment())); - return {autoBlockSize: 0, childFragments, data: {sab: new SharedArrayBuffer(4) }}; + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + return {autoBlockSize: 0, childFragments, data: {sab: new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer }}; } }); diff --git a/testing/web-platform/tests/xhr/send-data-sharedarraybuffer.any.js b/testing/web-platform/tests/xhr/send-data-sharedarraybuffer.any.js index b902888f5600e..912f622697d53 100644 --- a/testing/web-platform/tests/xhr/send-data-sharedarraybuffer.any.js +++ b/testing/web-platform/tests/xhr/send-data-sharedarraybuffer.any.js @@ -1,8 +1,9 @@ // META: title=XMLHttpRequest.send(sharedarraybuffer) test(() => { - var xhr = new XMLHttpRequest(); - var buf = new SharedArrayBuffer(); + const xhr = new XMLHttpRequest(); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const buf = new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer; xhr.open("POST", "./resources/content.py", true); assert_throws_js(TypeError, function() { @@ -13,8 +14,9 @@ test(() => { ["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "DataView"].forEach((type) => { test(() => { - var xhr = new XMLHttpRequest(); - var arr = new self[type](new SharedArrayBuffer()); + const xhr = new XMLHttpRequest(); + // See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` + const arr = new self[type](new WebAssembly.Memory({ shared:true, initial:1, maximum:1 }).buffer); xhr.open("POST", "./resources/content.py", true); assert_throws_js(TypeError, function() {