GeezerVison is showing github.com — test: wpt for Wasm jsapi including new ESM Integration tests · nodejs/node@cd391b5
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/common/wpt.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -922,7 +922,7 @@ class WPTRunner { | 922 | 922 | console.log(test.stack); | 923 | 923 | } | 924 | 924 | const command = `${process.execPath} ${process.execArgv}` + | 925 | | - ` ${require.main.filename} '${spec.filename}${spec.variant}'`; | | 925 | + ` ${require.main?.filename} '${spec.filename}${spec.variant}'`; | 926 | 926 | console.log(`Command: ${command}\n`); | 927 | 927 |
| 928 | 928 | reportResult?.addSubtest(test.name, 'FAIL', test.message); | |
Collapse file Copy file name to clipboardExpand all lines: test/common/wpt/worker.js +13-3Lines changed: 13 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | 'use strict'; | 2 | 2 |
| 3 | | -const { runInNewContext, runInThisContext } = require('vm'); | | 3 | +const { | | 4 | + runInNewContext, | | 5 | + runInThisContext, | | 6 | + constants: { USE_MAIN_CONTEXT_DEFAULT_LOADER }, | | 7 | +} = require('vm'); | 4 | 8 | const { setFlagsFromString } = require('v8'); | 5 | 9 | const { parentPort, workerData } = require('worker_threads'); | 6 | 10 |
| @@ -28,11 +32,14 @@ globalThis.fetch = function fetch(file) { | 28 | 32 | }; | 29 | 33 |
| 30 | 34 | if (workerData.initScript) { | 31 | | - runInThisContext(workerData.initScript); | | 35 | + runInThisContext(workerData.initScript, { | | 36 | + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, | | 37 | + }); | 32 | 38 | } | 33 | 39 |
| 34 | 40 | runInThisContext(workerData.harness.code, { | 35 | 41 | filename: workerData.harness.filename, | | 42 | + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, | 36 | 43 | }); | 37 | 44 |
| 38 | 45 | // eslint-disable-next-line no-undef | @@ -66,5 +73,8 @@ add_completion_callback((_, status) => { | 66 | 73 | }); | 67 | 74 |
| 68 | 75 | for (const scriptToRun of workerData.scriptsToRun) { | 69 | | - runInThisContext(scriptToRun.code, { filename: scriptToRun.filename }); | | 76 | + runInThisContext(scriptToRun.code, { | | 77 | + filename: scriptToRun.filename, | | 78 | + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, | | 79 | + }); | 70 | 80 | } |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,7 +31,7 @@ Last update: | 31 | 31 | - url: https://github.com/web-platform-tests/wpt/tree/fc3e651593/url | 32 | 32 | - urlpattern: https://github.com/web-platform-tests/wpt/tree/a2e15ad405/urlpattern | 33 | 33 | - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing | 34 | | -- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi | | 34 | +- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/65a2134d50/wasm/jsapi | 35 | 35 | - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi | 36 | 36 | - web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks | 37 | 37 | - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/2cb332d710/WebCryptoAPI | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/versions.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 84 | 84 | "path": "user-timing" | 85 | 85 | }, | 86 | 86 | "wasm/jsapi": { | 87 | | - "commit": "cde25e7e3c3b9d2280eb088a3fb9da988793d255", | | 87 | + "commit": "65a2134d50", | 88 | 88 | "path": "wasm/jsapi" | 89 | 89 | }, | 90 | 90 | "wasm/webapi": { | |
Collapse file Copy file name to clipboard +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +features: | | 2 | +- name: wasm | | 3 | + files: | | 4 | + - "*" |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/wasm/jsapi/assertions.js +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,6 +6,7 @@ function assert_function_name(fn, name, description) { | 6 | 6 | assert_true(propdesc.configurable, "configurable", `${description} name should be configurable`); | 7 | 7 | assert_equals(propdesc.value, name, `${description} name should be ${name}`); | 8 | 8 | } | | 9 | +globalThis.assert_function_name = assert_function_name; | 9 | 10 |
| 10 | 11 | function assert_function_length(fn, length, description) { | 11 | 12 | const propdesc = Object.getOwnPropertyDescriptor(fn, "length"); | @@ -15,6 +16,7 @@ function assert_function_length(fn, length, description) { | 15 | 16 | assert_true(propdesc.configurable, "configurable", `${description} length should be configurable`); | 16 | 17 | assert_equals(propdesc.value, length, `${description} length should be ${length}`); | 17 | 18 | } | | 19 | +globalThis.assert_function_length = assert_function_length; | 18 | 20 |
| 19 | 21 | function assert_exported_function(fn, { name, length }, description) { | 20 | 22 | if (WebAssembly.Function === undefined) { | @@ -28,6 +30,7 @@ function assert_exported_function(fn, { name, length }, description) { | 28 | 30 | assert_function_name(fn, name, description); | 29 | 31 | assert_function_length(fn, length, description); | 30 | 32 | } | | 33 | +globalThis.assert_exported_function = assert_exported_function; | 31 | 34 |
| 32 | 35 | function assert_Instance(instance, expected_exports) { | 33 | 36 | assert_equals(Object.getPrototypeOf(instance), WebAssembly.Instance.prototype, | @@ -77,6 +80,7 @@ function assert_Instance(instance, expected_exports) { | 77 | 80 | } | 78 | 81 | } | 79 | 82 | } | | 83 | +globalThis.assert_Instance = assert_Instance; | 80 | 84 |
| 81 | 85 | function assert_WebAssemblyInstantiatedSource(actual, expected_exports={}) { | 82 | 86 | assert_equals(Object.getPrototypeOf(actual), Object.prototype, | @@ -98,3 +102,4 @@ function assert_WebAssemblyInstantiatedSource(actual, expected_exports={}) { | 98 | 102 | assert_true(instance.configurable, "instance: configurable"); | 99 | 103 | assert_Instance(instance.value, expected_exports); | 100 | 104 | } | | 105 | +globalThis.assert_WebAssemblyInstantiatedSource = assert_WebAssemblyInstantiatedSource; |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/wasm/jsapi/bad-imports.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -183,3 +183,4 @@ function test_bad_imports(t) { | 183 | 183 | }); | 184 | 184 | } | 185 | 185 | } | | 186 | +globalThis.test_bad_imports = test_bad_imports; |
Collapse file Copy file name to clipboard +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +features: | | 2 | +- name: wasm | | 3 | + files: | | 4 | + - "*" | | 5 | + - "!multi-value.any.js" | | 6 | +- name: wasm-multi-value | | 7 | + files: | | 8 | + - "multi-value.any.js" |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/wasm/jsapi/constructor/compile.any.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -// META: global=window,dedicatedworker,jsshell | | 1 | +// META: global=window,dedicatedworker,jsshell,shadowrealm | 2 | 2 | // META: script=/wasm/jsapi/wasm-module-builder.js | 3 | 3 |
| 4 | 4 | function assert_Module(module) { | |
Collapse file Copy file name to clipboardExpand all lines: test/fixtures/wpt/wasm/jsapi/constructor/instantiate-bad-imports.any.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | | -// META: global=window,dedicatedworker,jsshell | | 1 | +// META: global=window,dedicatedworker,jsshell,shadowrealm | 2 | 2 | // META: script=/wasm/jsapi/wasm-module-builder.js | 3 | 3 | // META: script=/wasm/jsapi/bad-imports.js | 4 | 4 |
| |
|