summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/qstdweb
Commit message (Collapse)AuthorAgeFilesLines
* wasm: Handle exceptions in promiseEven Oscar Andersen2025-05-191-0/+23
| | | | | | Fixes: QTBUG-136962 Change-Id: I2d33b0132a83945b476f0f47fa4697ddaa2374b3 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: implement promise handler using suspendresumecontrolMorten Sørvig2025-04-151-24/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is required to make sure we resume the wasm instance when a promise resolves. As a bonus QWasmSuspendResumeControl already implements the JS -> C++ callback mapping, and we can removed the fixed-4 ThunkPool which the current implementation is using. The implementation is straightforward, where the only snag is that cleanup must be done in the finally callback. Implement Promise::all by calling JS Promise.all(). This function returns a new Promise, which we can adopt. Make two changes to the test: - remove throwInThen(): We no longer support propagating JS exceptions from the then() handler to the catch function. (catching a rejected promise still works). As far as I can see this functionality is not used in qtbase. - In finallyWithThen(), change shared_ptr<bool> to plain pointer. This works around a (mysterious) issue where we were not getting the correct value when reading from the shared_ptr. Change-Id: I8fb11b66ecba74f80708bd39eeeac59bb62f3786 Reviewed-by: Lorn Potter <[email protected]>
* wasm: Don't hardcode ASYNCIFY 1Morten Sørvig2024-12-021-4/+0
| | | | | | | | | Build for the "default" config only, which can be asyncyfy 0,1, or 2 depending on Qt build configuration. Change-Id: I29d9a11b30325491151fc4e621272e5390681fa7 Reviewed-by: Jøger Hansegård <[email protected]> Reviewed-by: Lorn Potter <[email protected]>
* Add copyright and licensing to build system files missing itLucie Gérard2024-05-211-1/+2
| | | | | | | Task-number: QTBUG-124453 Change-Id: Ibb6a0ab839a16ceef3c68861bac2f508ddb3d1ae Reviewed-by: Joerg Bornemann <[email protected]> Reviewed-by: Thiago Macieira <[email protected]>
* Change license for tests filesLucie Gérard2024-02-044-4/+4
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <[email protected]>
* wasm: add QIODevices for accessing JS dataMorten Sørvig2023-10-253-0/+138
| | | | | | | | | | | | | | | | BlobIoDevice: Supports reading data from a JS Blob, which can be a File (on disk) or some other object which can provide data. The native access functions are async and using this class requires that asyncify is available. Uint8ArrayIODevice: Supports reading and writing to a Uint8Array / ArrayBuffer. Similar to the existing QByteArray::fromEcmaUint8Array() API, except that it supports incremental accesss. Change-Id: Ic5de3534ff75eb6c745287b73b15ccd92d74ac2c Reviewed-by: Morten Johan Sørvig <[email protected]>
* Make WASM export names different across modulesMikolaj Boc2023-06-203-3/+3
| | | | | | | | The export name is now ${TARGET_NAME}Entry. This can also be overridden by using QT_WASM_EXPORT_NAME, both in CMake and qmake Change-Id: I59c97ae6e22f0b2720716e9d7eff7b6b13d37ab5 Reviewed-by: Morten Johan Sørvig <[email protected]>
* Modernize the qtloaderMikolaj Boc2023-06-051-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a minimal version of qtloader. The load function accepts the same arguments as emscripten runtime with a few additions: - qt.environment - qt.onExit - qt.containerElements - qt.fontDpi - qt.onLoaded - qt.entryFunction State handling has been removed in favor of making the load async (assume loading when the promise is live). Public APIs getting crashed status, exit text and code have been refactored into the new qt.onExit event fed to load. No need for keeping the state in the loader. The loader is integration-tested. A test module with test APIs has been created as a test harness. The runtime APIs exposed by Qt (font dpi and screen API) are handled by the qtloader seamlessly. Change-Id: Iaee65702667da0349a475feae6b83244d966d98d Reviewed-by: Morten Johan Sørvig <[email protected]>
* rhi: Make it a QPA-style private but semi-public APILaszlo Agocs2023-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qrhi.h, qshader.h, qshaderdescription.h (and qshaderbaker.h from shadertools; done separately) become "RHI APIs", following the concept of QPA APIs. Mirror completely what is done for QPA headers, but using the "rhi" prefix for the headers. This involves updating syncqt to handle the new category of headers. (a note on the regex: matching everything starting with "qrhi" is not acceptable due to incorrectly matching existing and future headers, hence specifying the four header names explicitly) There is going to be one difference to QPA: the documentation for everything RHI is going to be public and part of the regular docs, not hidden with \internal. In addition to the header renaming and adding the comments and documentation notes and warnings, there is one significant change here: there is no longer a need to do API-specific includes, such as qrhid3d11[_p].h, qrhivulkan[_p].h, etc. These are simply merged into a single header that is then included from qrhi.h. This means that users within Qt, and any future applications can just do #include <rhi/qrhi.h> (or rhi/qshader.h if the QRhi stuff is not relevant), no other headers are needed. There are no changes to functionality in this patch. Only the documentation is expanded, quite a lot, to eliminate all qdoc warnings and make the generated API docs complete. An example, with a quite extensive doc page is added as well. Task-number: QTBUG-113331 Change-Id: I91c749826348f14320cb335b1c83e9d1ea2b1d8b Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* Replace PUBLIC_LIBRARIES with LIBRARIES in qt_internal_add_manual_testAmir Masoud Abdol2023-04-131-2/+2
| | | | | | | | Noticed the warnings when building the manual tests. Pick-to: 6.5 Change-Id: I7f927f42f11d234ec3c980f36d8e12c0c49be712 Reviewed-by: Joerg Bornemann <[email protected]>
* rhi: Remove unused init flagLaszlo Agocs2023-04-121-1/+1
| | | | | Change-Id: I289452f39fd161da0e0d7bf329e0922df6bbde8a Reviewed-by: Christian Strømme <[email protected]>
* Fix the files_main testMikolaj Boc2023-02-231-9/+9
| | | | | | | | | The test does not build due to fbf2a3's change to QWasmLocalFileAccess API. Align it with the new API. Change-Id: I8e70e471c1f7dd812d3b2cf8e1bf33fd58310e81 Reviewed-by: Aleksandr Reviakin <[email protected]> Reviewed-by: Mikołaj Boc <[email protected]>
* Fix the qwasmcompositor_main testMikolaj Boc2022-12-071-8/+10
| | | | | | | This got broken with the introduction of the compositor patch. Change-Id: I7d85795eb537449855a4cce3c8b6b031095c3f7f Reviewed-by: David Skoland <[email protected]>
* Fix the workaround in ~QWasmOpenGLContextMikolaj Boc2022-10-213-0/+208
| | | | | | | | | | | | | The workaround stopped working because JSEvents is now not a global object. Update the workaround by exporting the JSEvents object from emscripten runtime and replacing the function that removes the event handlers to a dummy function that does nothing temporarily, only to revert it when the context is destroyed. Fixes: QTBUG-107197 Pick-to: 6.4 Change-Id: Icceae884c85e04fdafcca6cf3c563094d3f6f0dc Reviewed-by: Morten Johan Sørvig <[email protected]>
* Use the local file APIs to save/load files on WASMMikolaj Boc2022-08-123-0/+508
| | | | | | | | | | | | QFileDialog::saveFileContent, QFileDialog::getOpenFileContent are now using local file APIs to access files on any browser that passes a feature check. The feature is thoroughly tested using sinon and a new mock library. Task-number: QTBUG-99611 Change-Id: I3dd27a9d21eb143c71ea7db0563f70ac7db3a3ac Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <[email protected]>
* Make the promises js-less using a newly introduced thunk poolMikolaj Boc2022-07-071-110/+71
| | | | | | | | | | | | | | | | | Since we cannot rely on the clients specifying a suitable CSP that will not forbid execution of js injections, we have to refrain from using any explicit <script> elements. To keep the promise system working, a thunk pool was introduced which keeps track of a limited pool of promise callback exports. In case the resources are busy, pending calls are enqueued. This works since the JS Promise.then/catch/finally always fire, even on ready/failed promises. As the situation of full thunk pool allocation is unlikely to happen en masse IRL, the solution should not adversely affect the performance. Heavy unit tests were created to confirm the solution works as expected. Task-number: QTBUG-99611 Change-Id: I0e6982d4ee76a4263b59e72b004b3ff2f167e4df Reviewed-by: Morten Johan Sørvig <[email protected]>
* Port promise tests to qtwasmtestlibMikolaj Boc2022-07-063-0/+557
The promise tests have been ported to qtwasmtestlib so that they do not have to use asyncify anymore. Task-number: QTBUG-99611 Change-Id: Id1b5742c90e36a89540e7a2387cb4110c21ace9b Reviewed-by: Morten Johan Sørvig <[email protected]>