summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
* Use SPDX license identifiersLucie Gérard2022-11-155-245/+10
| | | | | | | | | Amends commit 05fc3aef53348fb58be6308076e000825b704e58. Some files were still missing. Task-number: QTBUG-67283 Change-Id: I78b3cbf31138192805b7e186337c6fda4ac844aa Reviewed-by: Jörg Bornemann <[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]>
* Introduce centralized means of checking for asyncifyMikolaj Boc2022-09-232-8/+7
| | | | | | | | The new function has an advantage of not requring EM_JS. Change-Id: Ib9ad0e6b59cfe2e6864697a14b5cfdb39f62af2d Reviewed-by: David Skoland <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: add manual auto-test for websockify-tunneled socketsMorten Sørvig2022-08-243-0/+404
| | | | | | | | | Test TCP sockets usage on the main thread, on secondary threads, and with asyncify. Pick-to: 6.4 Change-Id: I466df8c253c6a18a9c12d44fa8f53e76f81a0437 Reviewed-by: Lorn Potter <[email protected]>
* wasm: add echo_server test TCP serverMorten Sørvig2022-08-242-0/+141
| | | | | | | | Test server for in-browser TCP usage. Pick-to: 6.4 Change-Id: Ia1a29c0e14a6d2ee8075ce202c9f6998a3ccc4c9 Reviewed-by: Lorn Potter <[email protected]>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-2311-11/+11
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* Rename QT_DISABLE_DEPRECATED_BEFORE -> QT_DISABLE_DEPRECATED_UP_TOIvan Solovev2022-08-191-1/+1
| | | | | | | | | | | | | | The new name describes the behavior in a better way. [ChangeLog][Build System] The QT_DISABLE_DEPRECATED_BEFORE macro is renamed to QT_DISABLE_DEPRECATED_UP_TO. The old name is deprecated, but is still recognized if it is defined during configuration and the new name is not defined. Task-number: QTBUG-104944 Change-Id: Ifc34323e0bbd9e3dc2f86c3e80d4d0940ebccbb8 Reviewed-by: Alexandru Croitor <[email protected]> Reviewed-by: Edward Welbourne <[email protected]>
* wasm: always build asyncify tests for eventloop_autoMorten Sørvig2022-08-173-10/+58
| | | | | | | | | Add a runtime test for asyncify availability; skip tests if asyncify is not available. Add new build target which builds with asyncify enabled. Change-Id: Idaeff0a24aa01525927b012af2a0ba135c7839c3 Reviewed-by: Tor Arne Vestbø <[email protected]>
* wasm: add "skip" support to qtwasmtestlibMorten Sørvig2022-08-173-4/+28
| | | | | | | | | | | We're not looking to skip faulty tests, but there are cases where we would like to indicate that a test function exists but can't run because some precondition is not met. Pick-to: 6.4 Change-Id: Ifaaafcfa7a55beaaf56d8b25fabbe3dc2566350f Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Mikołaj Boc <[email protected]>
* wasm: include asyncify support unconditionallyMorten Sørvig2022-08-172-8/+5
| | | | | | | | | | | | | | | | | | | Emscripten's option for enabling asyncify (-sASYNCIFY) is a link-time option, which means there is no requirement to have a separate asyncify build, at least for static builds. Replace the current QT_HAVE_EMSCRIPTEN_ASYNCIFY compile-time option with a run-time option which checks if the asyncify API is available. Keep support for configuring with "-device-option QT_EMSCRIPTEN_ASYNCIFY=1" for backwards compatibility and for the use case where want asyncify support to be on by default for a given Qt build. Enable asyncify for the asyncify_exec example. Pick-to: 6.4 Change-Id: I301fd7e2d3c0367532c886f4e34b23e1093646ad Reviewed-by: Tor Arne Vestbø <[email protected]>
* Use the local file APIs to save/load files on WASMMikolaj Boc2022-08-125-46/+650
| | | | | | | | | | | | 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]>
* wasm: add event loop auto testMorten Sørvig2022-08-087-1/+352
| | | | | | | | | | Add basic tests for timers and event processing, for different use cases such as on the main thread, on a secondary thread, and with asyncify. Pick-to: 6.4 Change-Id: Ie0f82b5de97f639867b1e65dbb0ab8b11db86f85 Reviewed-by: Lorn Potter <[email protected]>
* Add license headers to cmake filesLucie Gérard2022-08-0311-0/+33
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <[email protected]>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-2813-14/+14
| | | | | Change-Id: I9b7404e1d3a78fe0726ec0f5ce1461f6c209e90d Reviewed-by: Alexey Edelev <[email protected]>
* wasm: add echo_client_mainthread exampleMorten Johan Sørvig2022-07-142-0/+107
| | | | | | | | | | | | | | | | This example connects an echo server running behind WebSockify, on localhost. For example, start websockify with websockify 1515 localhost:1516 to accept a webscoket connection on 1515 and forward to echo_server at 1516. Pick-to: 6.4 Change-Id: Id71364e4ab8c46d3482b515fcd1b991b61d7404b Reviewed-by: Lorn Potter <[email protected]>
* wasm: secondary thread blocking sockets exampleMorten Johan Sørvig2022-07-133-0/+105
| | | | | | | | Connects to echo_server via websockify, like the async version. Pick-to: 6.4 Change-Id: I9ed560cd388cfddbd0d284d8d40fb7ddf964ba96 Reviewed-by: Lorn Potter <[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]>
* wasm: begin work on accessibility backendMorten Sørvig2022-07-065-0/+78
| | | | | | | | | | | Implement a11y support by adding html elements of the appropriate type and/or with the appropriate ARIA attribute behind the canvas. Also add a simple manual-test. Change-Id: I2898fb038c1d326135a1341cdee323bc964420bb Reviewed-by: Lorn Potter <[email protected]>
* Port promise tests to qtwasmtestlibMikolaj Boc2022-07-064-0/+558
| | | | | | | | | 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]>
* Enhance the qtwasmtestlib with comparison functions and status reportingMikolaj Boc2022-07-054-83/+131
| | | | | | | | | | Added the functionality to report text statuses from tests, reporting file and line of assertion failures. Refactored the qtwasmtestlib.js for improved stability. Task-number: QTBUG-99611 Change-Id: I717e0cc38ac7f155fe870710f6b5e4bfb81b9317 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: add qtwasmtestlibMorten Johan Sørvig2022-06-295-0/+416
| | | | | | | | | | | | | | | | | | | | | | | | qtwasmtestlib supports writing asynchronous tests for the web platform. Asynchronous test functions differ from normal test functions in that they allow returning from the test function before the test has completed: void TestObject::testTimer() { QTimer::singleShot(100, [](){ completeTestFunction(); // Test pass if we get here }); } Currently one logging backend is supported which writes the results to an html element. See the README file for further documentation. Change-Id: Ia633ad3f41a653e40d6bf35dd09d62a97c608f84 Reviewed-by: Mikołaj Boc <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]>
* wasm: Improve wheel event handlingMorten Sørvig2022-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Always invert scroll deltas. This is what the code did before, expect for on non-Safari macOS. There is no need any "smart" code here: correct deltas are provided by the native API regardless of macOS scroll direction setting. Reading webkitDirectionInvertedFromDevice is still useful for certain use cases, such as 3D scene zooming or spinbox value change, where upwards motion on the trackpad should always correspond to "increment" regardless of scroll direction. Propagate this to Qt using one of the handleWheelEvent() overloads Finally, we were sending pixel deltas as angle deltas; fix by sending pixel deltas as well, but keep existing angle delta behavior for compatibility. Change-Id: I7a7104c30da057fefc0377816e551a9e7e2fa0e7 Reviewed-by: Lorn Potter <[email protected]> Reviewed-by: David Skoland <[email protected]>
* Use SPDX license identifiersLucie Gérard2022-05-1615-735/+30
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* wasm: add support for drag into browser windowLorn Potter2022-05-103-7/+83
| | | | | | | | | Drag and drop into the browser will work. Drag and drop out of the browser will not. Fixes: QTBUG-102242 Change-Id: Id9981ab6f9514535e1409bec18068790833a67a6 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: add fps counter to the rasterwindow testMorten Sørvig2022-04-192-0/+9
| | | | | | Change-Id: Iddda72287119bc3ee6495d746ac75d64ff0c2f2c Reviewed-by: Lorn Potter <[email protected]> Reviewed-by: David Skoland <[email protected]>
* wasm: make rasterwindow use non-deprecated APIMorten Johan Sørvig2022-04-121-3/+3
| | | | | | Pick-to: 6.3 Change-Id: I17f2c9517cb8b8e7103fc40068580f953ceb6aff Reviewed-by: Lorn Potter <[email protected]>
* wasm: add secondary thread exec manual testMorten Johan Sørvig2022-01-055-0/+132
| | | | | | Pick-to: 6.3 Change-Id: Id16cddd703682d325d77ad597996960a8f521d1c Reviewed-by: Lorn Potter <[email protected]>
* wasm: add rasterwindow manual testMorten Johan Sørvig2021-12-156-0/+383
| | | | | | | Simplest possible graphical app, with event logging. Change-Id: I6b1eb88c270a190becb23cc63d6d755ffbafcf52 Reviewed-by: Tor Arne Vestbø <[email protected]>
* wasm: improve clipboard supportLorn Potter2021-12-0810-0/+745
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for Clipboard API Add clipboard manual test Also includes these fixes: - improve clipboard use for chrome browser - make QClipboard::setText work - html copy and paste - image copy/paste Chrome browser supports text, html and png To use the Clipboard API, apps need to be served from a secure context (https). There is a fallback in the case of non secure context (http) - Firefox requires dom.events.asyncClipboard.read, dom.events.asyncClipboard.clipboardItem and dom.events.asyncClipboard.dataTransfer to be set from about:config, in order to support the Clipboard API. Change-Id: Ie4cb1bbb1dfc77e9655090a30967632780d15dd9 Fixes: QTBUG-74504 Fixes: QTBUG-93619 Fixes: QTBUG-79365 Fixes: QTBUG-86169 Reviewed-by: Morten Johan Sørvig <[email protected]>
* wasm: add asyncify manual testMorten Johan Sørvig2021-11-043-0/+85
| | | | | | | | Add simple QtCore-based test case which spins a nested event loop. Change-Id: Ia3a4ef76d561d0554faffcac8d36ae5dda2c6c53 Reviewed-by: Lorn Potter <[email protected]>
* wasm: add manual tests for main() and exec()Morten Johan Sørvig2021-08-2710-0/+367
| | | | | | | | | Add minimal examples which demonstrates how exec() works on Qt for WebAssembly and how to implement main() without calling QApplication::exec(). Change-Id: I44f1d16af19c538380cc56faf3f0f4cc9d66cf11 Reviewed-by: Tor Arne Vestbø <[email protected]>
* wasm: add cmake build for manual testsMorten Johan Sørvig2021-08-194-0/+37
| | | | | | | The tests can now be built with qt-cmake-standalone-test. Change-Id: I098340a9f755806061de281fbc25cb00c61f33f0 Reviewed-by: Tor Arne Vestbø <[email protected]>
* wasm: support all cursor shapesAlexandra Cherdantseva2019-12-305-0/+272
| | | | | | | | Every Qt::CursorShape is supported. Tested in Chrome, Firefox and Safari. Change-Id: I38c9024dba4af70af789ac84ad7e38f749c847d7 Reviewed-by: Lorn Potter <[email protected]>
* wasm: add local file access manual testMorten Johan Sørvig2019-10-292-0/+108
Testes file load and save, computes a sha256 hash for verifying file content. Change-Id: Id7f697c4dfd41e051442350f4050f04b493cfc18 Reviewed-by: Morten Johan Sørvig <[email protected]>