Morten Sørvig f5231e2dbb wasm: implement promise handler using suspendresumecontrol
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 <lorn.potter@qt.io>
2025-04-15 18:31:47 +02:00
..
2024-11-05 14:36:16 +01:00
2023-04-13 18:30:58 +02:00

This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.