From 3137d424cdf8e769a79a8379198ed620b8de39f1 Mon Sep 17 00:00:00 2001 From: Yusuke Suzuki Date: Thu, 15 Aug 2024 21:49:01 -0700 Subject: [PATCH] [JSC] Update wpt/wasm https://bugs.webkit.org/show_bug.cgi?id=278203 rdar://133998295 Reviewed by Mark Lam. Import latest wpt/wasm tests. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/assertions.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/bad-imports.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/compile.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/multi-value.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/toStringTag.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/basic.tentative.any.js: (promise_test.async const): (promise_test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/constructor.tentative.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.js: Added. (test.const.imports.module.jsfunc): (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/is.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/call.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/constructor.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/table.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/type.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.html: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.html: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/global-import.tentative.any.html: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.html: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/w3c-import.log. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/type.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-caching.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instanceTestFactory.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/interface.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-types.tentative.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/type.tentative.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.js: Added. (setup): (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/prototypes.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor-types.tentative.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/type.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/constructor.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/toString.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/type.tentative.any.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/wasm-module-builder.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-source-phase.js: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.js: * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html: Added. Canonical link: https://commits.webkit.org/282330@main --- .../wasm/jsapi/assertions.js | 5 ++ .../wasm/jsapi/bad-imports.js | 1 + .../wasm/jsapi/constructor/compile.any.js | 2 +- .../instantiate-bad-imports.any.js | 2 +- .../wasm/jsapi/constructor/instantiate.any.js | 2 +- .../wasm/jsapi/constructor/multi-value.any.js | 2 +- .../wasm/jsapi/constructor/toStringTag.any.js | 2 +- .../wasm/jsapi/constructor/validate.any.js | 2 +- .../jsapi/exception/basic.tentative.any.js | 18 +++--- .../exception/constructor.tentative.any.js | 10 +-- .../getArg.tentative.any-expected.txt | 4 +- .../jsapi/exception/getArg.tentative.any.js | 4 +- .../getArg.tentative.any.worker-expected.txt | 4 +- .../identity.tentative.any-expected.txt | 3 + .../exception/identity.tentative.any.html | 1 + .../jsapi/exception/identity.tentative.any.js | 61 +++++++++++++++++++ ...identity.tentative.any.worker-expected.txt | 3 + .../identity.tentative.any.worker.html | 1 + .../wasm/jsapi/exception/is.tentative.any.js | 2 +- .../jsapi/exception/toString.tentative.any.js | 6 +- .../wasm/jsapi/exception/w3c-import.log | 1 + .../wasm/jsapi/function/call.tentative.any.js | 2 +- .../function/constructor.tentative.any.js | 2 +- .../jsapi/function/table.tentative.any.js | 2 +- .../wasm/jsapi/function/type.tentative.any.js | 2 +- .../wasm/jsapi/gc/casts.tentative.any.html | 1 - .../casts.tentative.any.worker-expected.txt | 13 ++++ .../jsapi/gc/casts.tentative.any.worker.html | 1 + .../gc/exported-object.tentative.any.html | 1 - ...d-object.tentative.any.worker-expected.txt | 21 +++++++ .../exported-object.tentative.any.worker.html | 1 + .../jsapi/gc/global-import.tentative.any.html | 1 - .../wasm/jsapi/gc/i31.tentative.any.html | 1 - .../gc/i31.tentative.any.worker-expected.txt | 8 +++ .../jsapi/gc/i31.tentative.any.worker.html | 1 + .../wasm/jsapi/gc/w3c-import.log | 19 ++++++ .../wasm/jsapi/global/constructor.any.js | 2 +- .../wasm/jsapi/global/toString.any.js | 2 +- .../wasm/jsapi/global/type.tentative.any.js | 2 +- .../wasm/jsapi/global/value-get-set.any.js | 2 +- .../wasm/jsapi/global/valueOf.any.js | 2 +- .../instance/constructor-bad-imports.any.js | 2 +- .../jsapi/instance/constructor-caching.any.js | 2 +- .../wasm/jsapi/instance/constructor.any.js | 2 +- .../wasm/jsapi/instance/exports.any.js | 2 +- .../wasm/jsapi/instance/toString.any.js | 2 +- .../wasm/jsapi/instanceTestFactory.js | 2 + .../wasm/jsapi/interface.any.js | 2 +- .../constructor-shared.tentative.any.js | 2 +- .../memory/constructor-types.tentative.any.js | 4 +- .../wasm/jsapi/memory/constructor.any.js | 2 +- .../wasm/jsapi/memory/grow.any.js | 2 +- .../wasm/jsapi/memory/type.tentative.any.js | 4 +- .../wasm/jsapi/module/constructor.any.js | 2 +- .../wasm/jsapi/module/customSections.any.js | 2 +- .../wasm/jsapi/module/exports.any.js | 2 +- .../wasm/jsapi/module/imports.any.js | 2 +- .../moduleSource.tentative.any-expected.txt | 6 ++ .../module/moduleSource.tentative.any.html | 1 + .../module/moduleSource.tentative.any.js | 35 +++++++++++ ...leSource.tentative.any.worker-expected.txt | 6 ++ .../moduleSource.tentative.any.worker.html | 1 + .../wasm/jsapi/module/toString.any.js | 2 +- .../wasm/jsapi/module/w3c-import.log | 1 + .../wasm/jsapi/prototypes.any.js | 2 +- .../table/constructor-types.tentative.any.js | 4 +- .../wasm/jsapi/table/constructor.any.js | 2 +- .../wasm/jsapi/table/get-set.any.js | 2 +- .../wasm/jsapi/table/grow.any.js | 2 +- .../wasm/jsapi/table/length.any.js | 2 +- .../wasm/jsapi/table/toString.any.js | 2 +- .../wasm/jsapi/table/type.tentative.any.js | 2 +- .../jsapi/tag/constructor.tentative.any.js | 2 +- .../wasm/jsapi/tag/toString.tentative.any.js | 2 +- .../wasm/jsapi/tag/type.tentative.any.js | 2 +- .../wasm/jsapi/wasm-module-builder.js | 5 ++ .../esm-integration/resources/w3c-import.log | 1 + .../resources/worker-source-phase.js | 10 +++ .../esm-integration/resources/worker.js | 3 +- ...ipt-src-allows-wasm.tentative-expected.txt | 5 ++ .../script-src-allows-wasm.tentative.html | 21 +++++++ ...src-blocks-wasm.tentative.sub-expected.txt | 5 ++ .../script-src-blocks-wasm.tentative.sub.html | 21 +++++++ .../source-phase.tentative-expected.txt | 5 ++ .../source-phase.tentative.html | 35 +++++++++++ .../webapi/esm-integration/w3c-import.log | 4 ++ ...import-source-phase.tentative-expected.txt | 6 ++ .../worker-import-source-phase.tentative.html | 13 ++++ 88 files changed, 396 insertions(+), 72 deletions(-) create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.js create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/w3c-import.log create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.js create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-source-phase.js create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative.html create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative-expected.txt create mode 100644 LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/assertions.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/assertions.js index 162f5a9a6b8dc..3b370190682a3 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/assertions.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/assertions.js @@ -6,6 +6,7 @@ function assert_function_name(fn, name, description) { assert_true(propdesc.configurable, "configurable", `${description} name should be configurable`); assert_equals(propdesc.value, name, `${description} name should be ${name}`); } +globalThis.assert_function_name = assert_function_name; function assert_function_length(fn, length, description) { const propdesc = Object.getOwnPropertyDescriptor(fn, "length"); @@ -15,6 +16,7 @@ function assert_function_length(fn, length, description) { assert_true(propdesc.configurable, "configurable", `${description} length should be configurable`); assert_equals(propdesc.value, length, `${description} length should be ${length}`); } +globalThis.assert_function_length = assert_function_length; function assert_exported_function(fn, { name, length }, description) { if (WebAssembly.Function === undefined) { @@ -28,6 +30,7 @@ function assert_exported_function(fn, { name, length }, description) { assert_function_name(fn, name, description); assert_function_length(fn, length, description); } +globalThis.assert_exported_function = assert_exported_function; function assert_Instance(instance, expected_exports) { assert_equals(Object.getPrototypeOf(instance), WebAssembly.Instance.prototype, @@ -77,6 +80,7 @@ function assert_Instance(instance, expected_exports) { } } } +globalThis.assert_Instance = assert_Instance; function assert_WebAssemblyInstantiatedSource(actual, expected_exports={}) { assert_equals(Object.getPrototypeOf(actual), Object.prototype, @@ -98,3 +102,4 @@ function assert_WebAssemblyInstantiatedSource(actual, expected_exports={}) { assert_true(instance.configurable, "instance: configurable"); assert_Instance(instance.value, expected_exports); } +globalThis.assert_WebAssemblyInstantiatedSource = assert_WebAssemblyInstantiatedSource; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/bad-imports.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/bad-imports.js index 786fc650e326b..c7c9c6b6cdd13 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/bad-imports.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/bad-imports.js @@ -183,3 +183,4 @@ function test_bad_imports(t) { }); } } +globalThis.test_bad_imports = test_bad_imports; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/compile.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/compile.any.js index e94ce11717369..f822aa30e69eb 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/compile.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/compile.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js function assert_Module(module) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.js index 30252bd6eeb3a..e4926c8d70a86 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate-bad-imports.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/bad-imports.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.js index 8152f3a56f3f4..34e005c470093 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/instantiate.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/instanceTestFactory.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/multi-value.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/multi-value.any.js index 4b06d1da3c49b..8786f9b953ba1 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/multi-value.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/multi-value.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/toStringTag.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/toStringTag.any.js index c6d2cdaf662e8..5fae8304f8c0f 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/toStringTag.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/toStringTag.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm "use strict"; // https://webidl.spec.whatwg.org/#es-namespaces diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.js index 8b4f4582ab298..fce43d1e175f4 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/constructor/validate.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js let emptyModuleBinary; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/basic.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/basic.tentative.any.js index 9d18471d7819e..cacce99d9cb22 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/basic.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/basic.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,worker,jsshell +// META: global=window,worker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js function assert_throws_wasm(fn, message) { @@ -13,11 +13,11 @@ function assert_throws_wasm(fn, message) { promise_test(async () => { const kSig_v_r = makeSig([kWasmExternRef], []); const builder = new WasmModuleBuilder(); - const except = builder.addTag(kSig_v_r); + const tagIndex = builder.addTag(kSig_v_r); builder.addFunction("throw_param", kSig_v_r) .addBody([ kExprLocalGet, 0, - kExprThrow, except, + kExprThrow, tagIndex, ]) .exportFunc(); const buffer = builder.toBuffer(); @@ -44,11 +44,11 @@ promise_test(async () => { promise_test(async () => { const builder = new WasmModuleBuilder(); - const except = builder.addTag(kSig_v_a); + const tagIndex = builder.addTag(kSig_v_a); builder.addFunction("throw_null", kSig_v_v) .addBody([ kExprRefNull, kAnyFuncCode, - kExprThrow, except, + kExprThrow, tagIndex, ]) .exportFunc(); const buffer = builder.toBuffer(); @@ -58,11 +58,11 @@ promise_test(async () => { promise_test(async () => { const builder = new WasmModuleBuilder(); - const except = builder.addTag(kSig_v_i); + const tagIndex = builder.addTag(kSig_v_i); builder.addFunction("throw_int", kSig_v_v) .addBody([ ...wasmI32Const(7), - kExprThrow, except, + kExprThrow, tagIndex, ]) .exportFunc(); const buffer = builder.toBuffer(); @@ -73,12 +73,12 @@ promise_test(async () => { promise_test(async () => { const builder = new WasmModuleBuilder(); const fnIndex = builder.addImport("module", "fn", kSig_v_v); - const except = builder.addTag(kSig_v_r); + const tagIndex= builder.addTag(kSig_v_r); builder.addFunction("catch_exception", kSig_r_v) .addBody([ kExprTry, kWasmStmt, kExprCallFunction, fnIndex, - kExprCatch, except, + kExprCatch, tagIndex, kExprReturn, kExprEnd, kExprRefNull, kExternRefCode, diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/constructor.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/constructor.tentative.any.js index 0fd47b455e023..a46d1816c351d 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/constructor.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/constructor.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js test(() => { @@ -18,8 +18,8 @@ test(() => { }, "No arguments"); test(() => { - const argument = new WebAssembly.Tag({ parameters: [] }); - assert_throws_js(TypeError, () => WebAssembly.Exception(argument)); + const tag = new WebAssembly.Tag({ parameters: [] }); + assert_throws_js(TypeError, () => WebAssembly.Exception(tag)); }, "Calling"); test(() => { @@ -53,10 +53,10 @@ test(() => { ["i64", undefined], ]; for (const typeAndArg of typesAndArgs) { - const exn = new WebAssembly.Tag({ parameters: [typeAndArg[0]] }); + const tag = new WebAssembly.Tag({ parameters: [typeAndArg[0]] }); assert_throws_js( TypeError, - () => new WebAssembly.Exception(exn, typeAndArg[1]) + () => new WebAssembly.Exception(tag, typeAndArg[1]) ); } }, "Invalid exception argument"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt index 383f6cad7eee1..723d5821bffa0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any-expected.txt @@ -2,6 +2,8 @@ PASS Missing arguments PASS Invalid exception argument PASS Index out of bounds -PASS Getting out-of-range argument +FAIL Getting out-of-range argument assert_throws_js: function "() => exn.getArg(tag, value)" threw object "TypeError: Expect an integer argument in the range: [0, 2^32 - 1]" ("TypeError") expected instance of function "function RangeError() { + [native code] +}" ("RangeError") PASS getArg diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js index 4b72c61f47b7e..87719c7ebdfb8 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/memory/assertions.js test(() => { @@ -43,7 +43,7 @@ test(() => { const tag = new WebAssembly.Tag({ parameters: [] }); const exn = new WebAssembly.Exception(tag, []); for (const value of outOfRangeValues) { - assert_throws_js(TypeError, () => exn.getArg(tag, value)); + assert_throws_js(RangeError, () => exn.getArg(tag, value)); } }, "Getting out-of-range argument"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt index 383f6cad7eee1..723d5821bffa0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.worker-expected.txt @@ -2,6 +2,8 @@ PASS Missing arguments PASS Invalid exception argument PASS Index out of bounds -PASS Getting out-of-range argument +FAIL Getting out-of-range argument assert_throws_js: function "() => exn.getArg(tag, value)" threw object "TypeError: Expect an integer argument in the range: [0, 2^32 - 1]" ("TypeError") expected instance of function "function RangeError() { + [native code] +}" ("RangeError") PASS getArg diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any-expected.txt new file mode 100644 index 0000000000000..6c1c34da3485d --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any-expected.txt @@ -0,0 +1,3 @@ + +PASS Identity check + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.js new file mode 100644 index 0000000000000..2675668ec73a9 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.js @@ -0,0 +1,61 @@ +// META: global=window,dedicatedworker,jsshell,shadowrealm +// META: script=/wasm/jsapi/assertions.js +// META: script=/wasm/jsapi/wasm-module-builder.js + +test(() => { + const tag = new WebAssembly.Tag({ parameters: ["i32"] }); + const exn = new WebAssembly.Exception(tag, [42]); + const exn_same_payload = new WebAssembly.Exception(tag, [42]); + const exn_diff_payload = new WebAssembly.Exception(tag, [53]); + + const builder = new WasmModuleBuilder(); + const jsfuncIndex = builder.addImport("module", "jsfunc", kSig_v_v); + const tagIndex = builder.addImportedTag("module", "tag", kSig_v_i); + const imports = { + module: { + jsfunc: function() { throw exn; }, + tag: tag + } + }; + + builder + .addFunction("catch_rethrow", kSig_v_v) + .addBody([ + kExprTry, kWasmStmt, + kExprCallFunction, jsfuncIndex, + kExprCatch, tagIndex, + kExprDrop, + kExprRethrow, 0x00, + kExprEnd + ]) + .exportFunc(); + + builder + .addFunction("catch_all_rethrow", kSig_v_v) + .addBody([ + kExprTry, kWasmStmt, + kExprCallFunction, jsfuncIndex, + kExprCatchAll, + kExprRethrow, 0x00, + kExprEnd + ]) + .exportFunc(); + + const buffer = builder.toBuffer(); + WebAssembly.instantiate(buffer, imports).then(result => { + try { + result.instance.exports.catch_rethrow(); + } catch (e) { + assert_equals(e, exn); + assert_not_equals(e, exn_same_payload); + assert_not_equals(e, exn_diff_payload); + } + try { + result.instance.exports.catch_all_rethrow(); + } catch (e) { + assert_equals(e, exn); + assert_not_equals(e, exn_same_payload); + assert_not_equals(e, exn_diff_payload); + } + }); +}, "Identity check"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker-expected.txt new file mode 100644 index 0000000000000..6c1c34da3485d --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker-expected.txt @@ -0,0 +1,3 @@ + +PASS Identity check + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.worker.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/is.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/is.tentative.any.js index e28a88a3c5fdc..840d00bf0d47a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/is.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/is.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/memory/assertions.js test(() => { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.js index 52635186c762f..6885cf0deb691 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.js @@ -1,10 +1,10 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const argument = { parameters: [] }; const tag = new WebAssembly.Tag(argument); - const exception = new WebAssembly.Exception(tag, []); - assert_class_string(exception, "WebAssembly.Exception"); + const exn = new WebAssembly.Exception(tag, []); + assert_class_string(exn, "WebAssembly.Exception"); }, "Object.prototype.toString on an Exception"); test(() => { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/w3c-import.log index 24607d163cbc4..c99da5bcd5da4 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/w3c-import.log @@ -17,5 +17,6 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/basic.tentative.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/constructor.tentative.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/getArg.tentative.any.js +/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/identity.tentative.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/is.tentative.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/exception/toString.tentative.any.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/call.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/call.tentative.any.js index 626cd13c9f009..2e63d5fa103fd 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/call.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/call.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function addxy(x, y) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/constructor.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/constructor.tentative.any.js index 636aeca4dc1fa..fc92fcfaf0cf4 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/constructor.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/constructor.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function addxy(x, y) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/table.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/table.tentative.any.js index d7d0d86e3b6a8..f0dd6ea6f8589 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/table.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/table.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function testfunc(n) {} diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/type.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/type.tentative.any.js index e01a23a9e4339..72a7f1bfbe5e0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/type.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/function/type.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function addNumbers(x, y, z) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.html index ad7b352ff2bc9..9ec70b26b7dd0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.html +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.html @@ -1,2 +1 @@ - diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker-expected.txt new file mode 100644 index 0000000000000..be45f4d4879e7 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker-expected.txt @@ -0,0 +1,13 @@ + +PASS anyref casts +PASS eqref casts +PASS structref casts +PASS arrayref casts +PASS i31ref casts +PASS funcref casts +PASS externref casts +PASS null casts +PASS concrete struct casts +PASS concrete array casts +PASS concrete func casts + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.worker.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.html index ad7b352ff2bc9..9ec70b26b7dd0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.html +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.html @@ -1,2 +1 @@ - diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker-expected.txt new file mode 100644 index 0000000000000..3f99b04f5913f --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker-expected.txt @@ -0,0 +1,21 @@ + +PASS property access +PASS property assignment (strict mode) +PASS property assignment (non-strict mode) +PASS ownPropertyNames +PASS defineProperty +PASS delete (strict mode) +PASS delete (non-strict mode) +PASS getPrototypeOf +PASS setPrototypeOf +PASS isExtensible +PASS preventExtensions +PASS sealing +PASS typeof +PASS toString +PASS valueOf +PASS GC objects as map keys +PASS GC objects as set element +PASS GC objects as weak map keys +PASS GC objects as weak set element + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.worker.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/global-import.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/global-import.tentative.any.html index ad7b352ff2bc9..9ec70b26b7dd0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/global-import.tentative.any.html +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/global-import.tentative.any.html @@ -1,2 +1 @@ - diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.html index d2734d3574777..9ec70b26b7dd0 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.html +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.html @@ -1,2 +1 @@ - diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker-expected.txt new file mode 100644 index 0000000000000..e3d4a875e0849 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker-expected.txt @@ -0,0 +1,8 @@ + +PASS i31ref conversion to Number +PASS Number conversion to i31ref +PASS Check i31ref argument type +PASS Numbers in i31 range are i31ref, not hostref +PASS i31ref global +PASS i31ref table + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.worker.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/w3c-import.log new file mode 100644 index 0000000000000..cf74a44445b98 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/w3c-import.log @@ -0,0 +1,19 @@ +The tests in this directory were imported from the W3C repository. +Do NOT modify these tests directly in WebKit. +Instead, create a pull request on the WPT github: + https://github.com/web-platform-tests/wpt + +Then run the Tools/Scripts/import-w3c-tests in WebKit to reimport + +Do NOT modify or remove this file. + +------------------------------------------------------------------------ +Properties requiring vendor prefixes: +None +Property values requiring vendor prefixes: +None +------------------------------------------------------------------------ +List of files: +/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/casts.tentative.any.js +/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/exported-object.tentative.any.js +/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/gc/i31.tentative.any.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.js index dade7b1f55a43..f83f77a5c3ecf 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function assert_Global(actual, expected) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.js index 359c4273b5bd7..b308498982ee5 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/toString.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const argument = { "value": "i32" }; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/type.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/type.tentative.any.js index 95adc2af0f681..78d612529dd3f 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/type.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/type.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function assert_type(argument) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.js index f95b7ca9e3f0d..bee5581f41814 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/value-get-set.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const thisValues = [ diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.js index 0695a5a61fbc6..5bcb171825898 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/global/valueOf.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const argument = { "value": "i32" }; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.js index e4a5abb8eb216..1ef4f8423de85 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-bad-imports.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/bad-imports.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-caching.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-caching.any.js index 1aa4739b6294d..f969364d93f46 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-caching.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor-caching.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js function getExports() { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.js index 26390ebd2cdb2..24bf97356c83a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/instanceTestFactory.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.js index 6dcfbcee950d8..f7244923d83c5 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/exports.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js let emptyModuleBinary; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js index 547a9ca8295f5..d77037d65b9c2 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instance/toString.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js test(() => { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instanceTestFactory.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instanceTestFactory.js index 7936810a52d5a..2e015af8198a6 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instanceTestFactory.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/instanceTestFactory.js @@ -759,3 +759,5 @@ const instanceTestFactory = [ } ], ]; + +globalThis.instanceTestFactory = instanceTestFactory; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/interface.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/interface.any.js index 19d29ead0a726..8256fc209a7f6 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/interface.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/interface.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function test_operations(object, object_name, operations) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js index 216fc4ca55591..0134b307749ed 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-shared.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/memory/assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-types.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-types.tentative.any.js index d5378dbe82b00..4653c6686a78e 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-types.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor-types.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/memory/assertions.js @@ -17,4 +17,4 @@ test(() => { const argument = { minimum: 4 }; const memory = new WebAssembly.Memory(argument); assert_Memory(memory, { "size": 4 }); - }, "Non-zero minimum"); \ No newline at end of file + }, "Non-zero minimum"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.js index 0a0be11e37087..8f413c9f48a86 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/memory/assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.js index c511129491f4d..2eafe5761eaa6 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/grow.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/memory/assertions.js test(() => { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/type.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/type.tentative.any.js index a96a3227adca7..3f6531f5967ed 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/type.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/memory/type.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function assert_type(argument) { @@ -34,4 +34,4 @@ test(() => { test(() => { assert_type({ "minimum": 0, "maximum": 10, "shared": true}); -}, "shared memory"); \ No newline at end of file +}, "shared memory"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.js index 9978f7e6ac8f2..95604aabe475a 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.js index 4029877e92c7b..96958316e061d 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js function assert_ArrayBuffer(buffer, expected) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.js index 0d62725ae4b2f..0c32e984a2cad 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js let emptyModuleBinary; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.js index ec550ce6c41af..2ab1725359f18 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js function assert_ModuleImportDescriptor(import_, expected) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any-expected.txt new file mode 100644 index 0000000000000..fe8b221195029 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any-expected.txt @@ -0,0 +1,6 @@ + +PASS AbstractModuleSource is not a global +FAIL AbstractModuleSource intrinsic assert_equals: expected "AbstractModuleSource" but got "" +FAIL AbstractModuleSourceProto intrinsic assert_not_equals: got disallowed value object "[object Object]" +FAIL AbstractModuleSourceProto toStringTag brand check undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(AbstractModuleSource.prototype, Symbol.toStringTag)') + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.js new file mode 100644 index 0000000000000..8a94cdd48cd49 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.js @@ -0,0 +1,35 @@ +// META: global=window,dedicatedworker,jsshell,shadowrealm +// META: script=/wasm/jsapi/wasm-module-builder.js +// META: script=/wasm/jsapi/assertions.js + +let emptyModuleBinary; +setup(() => { + emptyModuleBinary = new WasmModuleBuilder().toBuffer(); +}); + +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); +}, "AbstractModuleSource intrinsic"); + +test(() => { + const AbstractModuleSourceProto = Object.getPrototypeOf(WebAssembly.Module.prototype); + assert_not_equals(AbstractModuleSourceProto, Object.prototype); + const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); + assert_equals(AbstractModuleSource.prototype, AbstractModuleSourceProto); +}, "AbstractModuleSourceProto intrinsic"); + +test(() => { + const module = new WebAssembly.Module(emptyModuleBinary); + + const AbstractModuleSource = Object.getPrototypeOf(WebAssembly.Module); + const toStringTag = Object.getOwnPropertyDescriptor(AbstractModuleSource.prototype, Symbol.toStringTag).get; + + assert_equals(toStringTag.call(module), "WebAssembly.Module"); + assert_throws_js(TypeError, () => toStringTag.call({})); +}, "AbstractModuleSourceProto toStringTag brand check"); \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker-expected.txt new file mode 100644 index 0000000000000..fe8b221195029 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker-expected.txt @@ -0,0 +1,6 @@ + +PASS AbstractModuleSource is not a global +FAIL AbstractModuleSource intrinsic assert_equals: expected "AbstractModuleSource" but got "" +FAIL AbstractModuleSourceProto intrinsic assert_not_equals: got disallowed value object "[object Object]" +FAIL AbstractModuleSourceProto toStringTag brand check undefined is not an object (evaluating 'Object.getOwnPropertyDescriptor(AbstractModuleSource.prototype, Symbol.toStringTag)') + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker.html new file mode 100644 index 0000000000000..2382913528e69 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.worker.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js index 1c20cd6108c84..10c707979d5bd 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js test(() => { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/w3c-import.log index e66a9856a6e17..5ff7908f10979 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/w3c-import.log @@ -18,4 +18,5 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/customSections.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/exports.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/imports.any.js +/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/moduleSource.tentative.any.js /LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/module/toString.any.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/prototypes.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/prototypes.any.js index 714f4f8430e5e..2316f7d9b4eeb 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/prototypes.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/prototypes.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/wasm-module-builder.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor-types.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor-types.tentative.any.js index 99ca41b55a915..b4015bdc6f750 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor-types.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor-types.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/table/assertions.js @@ -17,4 +17,4 @@ test(() => { const argument = { "element": "anyfunc", "minimum": 5 }; const table = new WebAssembly.Table(argument); assert_Table(table, { "length": 5 }); -}, "Non-zero minimum"); \ No newline at end of file +}, "Non-zero minimum"); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.js index 6d38d04e4f505..51b1070d41358 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/constructor.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=/wasm/jsapi/assertions.js // META: script=/wasm/jsapi/table/assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.js index 9301057a533ed..abe6fecac9860 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/get-set.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.js index 520d24bf4bafb..4038f1e64934b 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/grow.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/wasm-module-builder.js // META: script=assertions.js diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.js index a9ef095ded445..0e6de3f83e1ec 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/length.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const thisValues = [ diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js index 8a09f2832c1d6..b5fb25b9c1e95 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/toString.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const argument = { "element": "anyfunc", "initial": 0 }; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/type.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/type.tentative.any.js index ef1ceecb17d69..ef9bbc5aa4a22 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/type.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/table/type.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function assert_type(argument) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/constructor.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/constructor.tentative.any.js index de63e7bf46d1e..54edf8c8f5925 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/constructor.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/constructor.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js test(() => { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/toString.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/toString.tentative.any.js index ad9a4ba152f4f..76fff0feef063 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/toString.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/toString.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm test(() => { const argument = { parameters: [] }; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/type.tentative.any.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/type.tentative.any.js index 9d2f0de1a00f2..58c96078bfe39 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/type.tentative.any.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/tag/type.tentative.any.js @@ -1,4 +1,4 @@ -// META: global=window,dedicatedworker,jsshell +// META: global=window,dedicatedworker,jsshell,shadowrealm // META: script=/wasm/jsapi/assertions.js function assert_type(argument) { diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/wasm-module-builder.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/wasm-module-builder.js index 8c6519239b63c..1d8db0a6e6fd7 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/wasm-module-builder.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/jsapi/wasm-module-builder.js @@ -1487,6 +1487,7 @@ class WasmModuleBuilder { return new WebAssembly.Module(this.toBuffer(debug)); } } +globalThis.WasmModuleBuilder = WasmModuleBuilder; function wasmSignedLeb(val, max_len = 5) { let res = []; @@ -1503,10 +1504,12 @@ function wasmSignedLeb(val, max_len = 5) { throw new Error( 'Leb value <' + val + '> exceeds maximum length of ' + max_len); } +globalThis.wasmSignedLeb = wasmSignedLeb; function wasmI32Const(val) { return [kExprI32Const, ...wasmSignedLeb(val, 5)]; } +globalThis.wasmI32Const = wasmI32Const; function wasmF32Const(f) { // Write in little-endian order at offset 0. @@ -1515,6 +1518,7 @@ function wasmF32Const(f) { kExprF32Const, byte_view[0], byte_view[1], byte_view[2], byte_view[3] ]; } +globalThis.wasmI32Const = wasmI32Const; function wasmF64Const(f) { // Write in little-endian order at offset 0. @@ -1524,3 +1528,4 @@ function wasmF64Const(f) { byte_view[3], byte_view[4], byte_view[5], byte_view[6], byte_view[7] ]; } +globalThis.wasmF64Const = wasmF64Const; diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/w3c-import.log index a990aa55e40b7..a0d5b3fdd2e87 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/w3c-import.log @@ -47,5 +47,6 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/wasm-js-cycle.js /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/wasm-js-cycle.wasm /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-helper.js +/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-source-phase.js /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.js /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.wasm diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-source-phase.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-source-phase.js new file mode 100644 index 0000000000000..e1c2703899a50 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker-source-phase.js @@ -0,0 +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/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.js b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.js index c72464f71a456..1163e477fd727 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.js +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resources/worker.js @@ -1 +1,2 @@ -import * as mod from "./worker.wasm" +import * as mod from "./worker.wasm"; +assert_true(await import("./worker.wasm") === mod); diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative-expected.txt new file mode 100644 index 0000000000000..f479867aadbca --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative-expected.txt @@ -0,0 +1,5 @@ +CONSOLE MESSAGE: CompileError: Refused to create a WebAssembly object because 'unsafe-eval' or 'wasm-unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". + + +FAIL Importing a WebAssembly module should be allowed by script-src CSP. assert_array_equals: lengths differ, expected array ["executed"] length 1, got [] length 0 + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html new file mode 100644 index 0000000000000..07faf9a5a1cff --- /dev/null +++ b/LayoutTests/imported/w3c/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/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub-expected.txt new file mode 100644 index 0000000000000..6e8cb95805868 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub-expected.txt @@ -0,0 +1,5 @@ +CONSOLE MESSAGE: Refused to load https://127.0.0.1/resources/execute-start.wasm because it does not appear in the script-src directive of the Content Security Policy. +CONSOLE MESSAGE: Refused to load https://127.0.0.1/resources/execute-start.wasm because it does not appear in the script-src directive of the Content Security Policy. + +PASS Importing a WebAssembly module should be guarded by script-src CSP. + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub.html new file mode 100644 index 0000000000000..0d5c7ca6ed57f --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub.html @@ -0,0 +1,21 @@ + +script-src blocks Wasm execution + + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative-expected.txt new file mode 100644 index 0000000000000..b441ddf6fd7ba --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative-expected.txt @@ -0,0 +1,5 @@ +CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'exportedNamesSource'. Expected 'from' before imported module name. + +Harness Error (FAIL), message = SyntaxError: Unexpected identifier 'exportedNamesSource'. Expected 'from' before imported module name. + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative.html new file mode 100644 index 0000000000000..870b16bd0a0ce --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative.html @@ -0,0 +1,35 @@ + +Source phase imports + + + + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/w3c-import.log b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/w3c-import.log index 7dc0b77bf3cd5..3ac02ea22d0bf 100644 --- a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/w3c-import.log +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/w3c-import.log @@ -22,9 +22,13 @@ List of files: /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/module-parse-error.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resolve-export.js /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/resolve-export.tentative.html +/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-allows-wasm.tentative.html +/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/script-src-blocks-wasm.tentative.sub.html +/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/source-phase.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/wasm-import-wasm-export.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/wasm-import.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/wasm-js-cycle.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/wasm-to-wasm-link-error.tentative.html +/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import.tentative.html /LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker.tentative.html diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative-expected.txt new file mode 100644 index 0000000000000..07c854f2760a3 --- /dev/null +++ b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative-expected.txt @@ -0,0 +1,6 @@ +CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'modSource'. Expected 'from' before imported module name. + +Harness Error (TIMEOUT), message = null + +NOTRUN Testing import of WebAssembly source phase from JavaScript worker + diff --git a/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html b/LayoutTests/imported/w3c/web-platform-tests/wasm/webapi/esm-integration/worker-import-source-phase.tentative.html new file mode 100644 index 0000000000000..e193f3efc6933 --- /dev/null +++ b/LayoutTests/imported/w3c/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 + + + +