From 01dee87a5dd390adba93ed01d6e8d43e25cd1de7 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 28 Apr 2020 11:36:57 +0000 Subject: [PATCH] Bug 1632195 [wpt PR 23172] - Wasm: ensure expected results are booleans, a=testonly Automatic update from web-platform-tests Wasm: ensure expected results are booleans Follow-up to 6a1b15e5d699a00d58844b53e8c18d368169018d. -- wpt-commits: 0d43c214401f06e0adfb8dc1afd1a15b52109e28 wpt-pr: 23172 --- .../web-platform/tests/wasm/jsapi/memory/grow.any.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/testing/web-platform/tests/wasm/jsapi/memory/grow.any.js b/testing/web-platform/tests/wasm/jsapi/memory/grow.any.js index 0fac3cafa6e4..0cea8b4b1a63 100644 --- a/testing/web-platform/tests/wasm/jsapi/memory/grow.any.js +++ b/testing/web-platform/tests/wasm/jsapi/memory/grow.any.js @@ -1,14 +1,14 @@ // META: global=jsshell -function assert_ArrayBuffer(actual, expected, message) { +function assert_ArrayBuffer(actual, { size=0, shared=false, detached=false }, message) { // https://github.com/WebAssembly/spec/issues/840 // See https://github.com/whatwg/html/issues/5380 for why not `self.SharedArrayBuffer` const isShared = !("isView" in actual.constructor); - assert_equals(isShared, expected.shared, `${message}: constructor`); - const sharedString = expected.shared ? "Shared" : ""; + assert_equals(isShared, shared, `${message}: constructor`); + const sharedString = shared ? "Shared" : ""; assert_equals(actual.toString(), `[object ${sharedString}ArrayBuffer]`, `${message}: toString()`); assert_equals(Object.getPrototypeOf(actual).toString(), `[object ${sharedString}ArrayBuffer]`, `${message}: prototype toString()`); - if (expected.detached) { + if (detached) { // https://github.com/tc39/ecma262/issues/678 let byteLength; try { @@ -18,8 +18,8 @@ function assert_ArrayBuffer(actual, expected, message) { } assert_equals(byteLength, 0, `${message}: detached size`); } else { - assert_equals(actual.byteLength, 0x10000 * expected.size, `${message}: size`); - if (expected.size > 0) { + assert_equals(actual.byteLength, 0x10000 * size, `${message}: size`); + if (size > 0) { const array = new Uint8Array(actual); assert_equals(array[0], 0, `${message}: first element`); assert_equals(array[array.byteLength - 1], 0, `${message}: last element`);