From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../wasm/jsapi/module/moduleSource.tentative.any.js | 16 +++++----------- .../resources/worker-source-phase.js | 7 +++++++ .../script-src-allows-wasm.tentative.html | 21 +++++++++++++++++++++ .../script-src-blocks-wasm.tentative.html | 21 +++++++++++++++++++++ .../esm-integration/source-phase.tentative.html | 2 +- .../worker-import-source-phase.tentative.html | 13 +++++++++++++ 6 files changed, 68 insertions(+), 12 deletions(-) create mode 100644 testing/web-platform/tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html create mode 100644 testing/web-platform/tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.html create mode 100644 testing/web-platform/tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html (limited to 'testing/web-platform/tests/wasm') diff --git a/testing/web-platform/tests/wasm/jsapi/module/moduleSource.tentative.any.js b/testing/web-platform/tests/wasm/jsapi/module/moduleSource.tentative.any.js index a3d09d55d6..8a94cdd48c 100644 --- a/testing/web-platform/tests/wasm/jsapi/module/moduleSource.tentative.any.js +++ b/testing/web-platform/tests/wasm/jsapi/module/moduleSource.tentative.any.js @@ -9,6 +9,9 @@ setup(() => { test(() => { assert_equals(typeof AbstractModuleSource, "undefined"); +}, "AbstractModuleSource is not a global"); + +test(() => { const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); assert_equals(AbstractModuleSource.name, "AbstractModuleSource"); assert_not_equals(AbstractModuleSource, Function); @@ -16,22 +19,13 @@ test(() => { test(() => { const AbstractModuleSourceProto = Object.getPrototypeOf(WebAssembly.Module.prototype); - assert_not_equals(AbstractModuleSourceProto, Object); + assert_not_equals(AbstractModuleSourceProto, Object.prototype); const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); assert_equals(AbstractModuleSource.prototype, AbstractModuleSourceProto); }, "AbstractModuleSourceProto intrinsic"); test(() => { - const builder = new WasmModuleBuilder(); - - builder - .addFunction("fn", kSig_v_v) - .addBody([]) - .exportFunc(); - builder.addMemory(0, 256, true); - - const buffer = builder.toBuffer() - const module = new WebAssembly.Module(buffer); + const module = new WebAssembly.Module(emptyModuleBinary); const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); const toStringTag = Object.getOwnPropertyDescriptor(AbstractModuleSource.prototype, Symbol.toStringTag).get; diff --git a/testing/web-platform/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js b/testing/web-platform/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js index c7a4f0d437..e1c2703899 100644 --- a/testing/web-platform/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js +++ b/testing/web-platform/tests/wasm/webapi/esm-integration/resources/worker-source-phase.js @@ -1,3 +1,10 @@ import source modSource from "./worker.wasm"; +import { pm } from "./worker-helper.js"; assert_true(modSource instanceof WebAssembly.Module); assert_true(await import.source("./worker.wasm") === modSource); + +await WebAssembly.instantiate(modSource, { + "./worker-helper.js": { + "pm": pm + } +}); \ No newline at end of file diff --git a/testing/web-platform/tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html b/testing/web-platform/tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html new file mode 100644 index 0000000000..07faf9a5a1 --- /dev/null +++ b/testing/web-platform/tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html @@ -0,0 +1,21 @@ + +script-src allows Wasm execution + + + + + diff --git a/testing/web-platform/tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.html b/testing/web-platform/tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.html new file mode 100644 index 0000000000..c1232730ea --- /dev/null +++ b/testing/web-platform/tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.html @@ -0,0 +1,21 @@ + +script-src blocks Wasm execution + + + + + diff --git a/testing/web-platform/tests/wasm/webapi/esm-integration/source-phase.tentative.html b/testing/web-platform/tests/wasm/webapi/esm-integration/source-phase.tentative.html index eb415a4c6f..870b16bd0a 100644 --- a/testing/web-platform/tests/wasm/webapi/esm-integration/source-phase.tentative.html +++ b/testing/web-platform/tests/wasm/webapi/esm-integration/source-phase.tentative.html @@ -13,7 +13,7 @@ const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); assert_equals(AbstractModuleSource.name, "AbstractModuleSource"); assert_true(exportedNamesSource instanceof AbstractModuleSource); -assert_array_equals(WebAssembly.Module.exports(exportedNamesSource).sort(), +assert_array_equals(WebAssembly.Module.exports(exportedNamesSource).map(({ name }) => name).sort(), ["func", "glob", "mem", "tab"]); const wasmImportFromWasmSource = await import.source("./resources/wasm-import-from-wasm.wasm"); diff --git a/testing/web-platform/tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html b/testing/web-platform/tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html new file mode 100644 index 0000000000..e193f3efc6 --- /dev/null +++ b/testing/web-platform/tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html @@ -0,0 +1,13 @@ + +Testing import of WebAssembly source phase from JavaScript worker + + + + -- cgit v1.2.3