From 450cceb587613ac1469c5a131fac15935c99e0e7 Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Fri, 4 Oct 2024 19:00:54 +0200 Subject: [PATCH] Use BigInt parameter in 16gb-wasm-memory tests (#3696) The JS API for Memory was updated in https://github.com/WebAssembly/memory64/issues/68 to require BigInt parameters when the Memory type is i64. Also see chromium-side failures (https://crbug.com/370792790). --- sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html | 2 +- sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html | 2 +- .../conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html | 2 +- sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html | 2 +- sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html | 2 +- sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html index ca4d494e5..92228903d 100644 --- a/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/bufferdata-16gb-wasm-memory.html @@ -29,7 +29,7 @@ (() => { let view; try { - view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer); } catch (e) { testPassed(`Allocating ${SIZE} threw: ${e}`); return; diff --git a/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html index 7ce95d8e3..284840e5d 100644 --- a/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/buffersubdata-16gb-wasm-memory.html @@ -29,7 +29,7 @@ (() => { let view; try { - view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer); } catch (e) { testPassed(`Allocating ${SIZE} threw: ${e}`); return; diff --git a/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html index 724a9bfa1..42bfa781a 100644 --- a/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/getbuffersubdata-16gb-wasm-memory.html @@ -29,7 +29,7 @@ (() => { let view; try { - view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer); } catch (e) { testPassed(`Allocating ${SIZE} threw: ${e}`); return; diff --git a/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html index 21c65a2c7..844e0881b 100644 --- a/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/readpixels-16gb-wasm-memory.html @@ -30,7 +30,7 @@ (() => { let view; try { - view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer); } catch (e) { testPassed(`Allocating ${SIZE} threw: ${e}`); return; diff --git a/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html index 0f39e2ceb..791cc579b 100644 --- a/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/teximage2d-16gb-wasm-memory.html @@ -29,7 +29,7 @@ (() => { let view; try { - view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer); } catch (e) { testPassed(`Allocating ${SIZE} threw: ${e}`); return; diff --git a/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html b/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html index 7266e88f4..4af628139 100644 --- a/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html +++ b/sdk/tests/conformance2/wasm/texsubimage2d-16gb-wasm-memory.html @@ -29,7 +29,7 @@ (() => { let view; try { - view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: SIZE / PAGE }).buffer); + view = new Uint8Array(new WebAssembly.Memory({ index: 'i64', initial: BigInt(SIZE / PAGE) }).buffer); } catch (e) { testPassed(`Allocating ${SIZE} threw: ${e}`); return;