summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2023-06-09 11:19:52 +0200
committerMorten Sørvig <morten.sorvig@qt.io>2023-06-20 07:38:41 +0200
commitbc340abe877199af640d16f1fbeaf4b96c36fe14 (patch)
tree45929049f04605def44b0b45e1ee56bdeab1024c /tests/manual/wasm
parentc2988de88d54ddd63d270964e4561a9fce10d11e (diff)
wasm: Document (and rename) config.qt.module
This property can take a either a WebAssembly.Module or a promise to a module, and we don't have to specify the exact type in the property name. Pick-to: 6.6 Change-Id: Iebaf52178253afe8c93cf78bbe0853461bf48b67 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Diffstat (limited to 'tests/manual/wasm')
-rw-r--r--tests/manual/wasm/qtloader_integration/test_body.js22
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/manual/wasm/qtloader_integration/test_body.js b/tests/manual/wasm/qtloader_integration/test_body.js
index f23db3a978..d68c6ba8cc 100644
--- a/tests/manual/wasm/qtloader_integration/test_body.js
+++ b/tests/manual/wasm/qtloader_integration/test_body.js
@@ -177,7 +177,7 @@ export class QtLoaderIntegrationTests
// Fetch/Compile the module once; reuse for each instance. This is also if the page wants to
// initiate the .wasm file download fetch as early as possible, before the browser has
// finished fetching and parsing testapp.js and qtloader.js
- const modulePromise = WebAssembly.compileStreaming(fetch('tst_qtloader_integration.wasm'));
+ const module = WebAssembly.compileStreaming(fetch('tst_qtloader_integration.wasm'));
const instances = await Promise.all([1, 2, 3].map(i => qtLoad({
qt: {
@@ -186,7 +186,7 @@ export class QtLoaderIntegrationTests
width: `${i * 10}px`,
height: `${i * 10}px`,
})],
- modulePromise,
+ module,
}
})));
// Confirm the identity of instances by querying their screen widths and heights
@@ -230,14 +230,26 @@ export class QtLoaderIntegrationTests
assert.equal('Sample output!', accumulatedStdout);
}
+ async modulePromiseProvided()
+ {
+ await qtLoad({
+ qt: {
+ entryFunction: createQtAppInstance,
+ containerElements: [this.#testScreenContainers[0]],
+ module: WebAssembly.compileStreaming(
+ fetch('tst_qtloader_integration.wasm'))
+ }
+ });
+ }
+
async moduleProvided()
{
await qtLoad({
qt: {
entryFunction: createQtAppInstance,
containerElements: [this.#testScreenContainers[0]],
- modulePromise: WebAssembly.compileStreaming(
- await fetch('tst_qtloader_integration.wasm'))
+ module: await WebAssembly.compileStreaming(
+ fetch('tst_qtloader_integration.wasm'))
}
});
}
@@ -265,7 +277,7 @@ export class QtLoaderIntegrationTests
qt: {
entryFunction: createQtAppInstance,
containerElements: [this.#testScreenContainers[0]],
- modulePromise: Promise.reject(new Error('Failed to load')),
+ module: Promise.reject(new Error('Failed to load')),
}
});
} catch (e) {