diff options
author | Piotr Wierciński <piotr.wiercinski@qt.io> | 2024-04-02 16:55:07 +0200 |
---|---|---|
committer | Piotr Wierciński <piotr.wiercinski@qt.io> | 2024-05-10 09:55:19 +0000 |
commit | 9907ef0d64f743fbf269967a65005d490ba0a432 (patch) | |
tree | 2b918e0fe6752f6206eef4267d9f0af7a5f94c55 /tests/auto/wasm/fetchapi/tst_fetchapi.cpp | |
parent | 0ae44ccc6f3017213ba8a66d703b59c5fcb336a5 (diff) |
wasm: Allow fetching from background thread
Allow network request from background thread by proxing it to main
thread if needed.
Introduce "fetchHelper" which is stored on heap and owns
"outgoingData" which must be valid during entire fetch operation.
It is also used for synchronization between thread that has
scheduled fetch operation and the one that is executing it.
Enable the test that was skipped before fix.
Fixes: QTBUG-124111
Change-Id: Ifafa4c40fa435122639fa861a61fbf96340a7747
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Diffstat (limited to 'tests/auto/wasm/fetchapi/tst_fetchapi.cpp')
-rw-r--r-- | tests/auto/wasm/fetchapi/tst_fetchapi.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/auto/wasm/fetchapi/tst_fetchapi.cpp b/tests/auto/wasm/fetchapi/tst_fetchapi.cpp index 3dcd8dd916..e37316b2db 100644 --- a/tests/auto/wasm/fetchapi/tst_fetchapi.cpp +++ b/tests/auto/wasm/fetchapi/tst_fetchapi.cpp @@ -69,11 +69,9 @@ void tst_FetchApi::sendRequestOnMainThread() void tst_FetchApi::sendRequestOnBackgroundThread() { - QSKIP("Skip this test until we fix fetching from background threads."); QEventLoop mainEventLoop; BackgroundThread *backgroundThread = new BackgroundThread(); connect(backgroundThread, &BackgroundThread::finished, &mainEventLoop, &QEventLoop::quit); - connect(backgroundThread, &BackgroundThread::finished, backgroundThread, &QObject::deleteLater); backgroundThread->start(); mainEventLoop.exec(); |