summaryrefslogtreecommitdiffstats
path: root/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2023-02-23 10:14:23 +0100
committerMorten Sørvig <morten.sorvig@qt.io>2023-06-05 23:14:28 +0200
commitb9491daad0ed1c4b9c74e0c3b23f87eb7ad4f37d (patch)
tree6d136051f07471cc40a12c20ed14d7b088cb9e61 /tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
parent821a4234d04043417d0880f23479c170b062ea58 (diff)
Modernize the qtloader
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 <morten.sorvig@qt.io>
Diffstat (limited to 'tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp')
-rw-r--r--tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp b/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
index 6866fe229f6..df6df5f4533 100644
--- a/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
+++ b/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
@@ -94,10 +94,8 @@ public:
QWasmCompositorTest() : m_window(val::global("window")), m_testSupport(val::object())
{
m_window.set("testSupport", m_testSupport);
- m_testSupport.set("qtAddContainerElement",
- emscripten::val::module_property("qtAddContainerElement"));
- m_testSupport.set("qtRemoveContainerElement",
- emscripten::val::module_property("qtRemoveContainerElement"));
+ m_testSupport.set("qtSetContainerElements",
+ emscripten::val::module_property("qtSetContainerElements"));
}
~QWasmCompositorTest() noexcept
@@ -118,12 +116,12 @@ private:
});
m_cleanup.emplace_back([]() mutable {
EM_ASM({
- testSupport.qtRemoveContainerElement(testSupport.screenElement);
+ testSupport.qtSetContainerElements([]);
testSupport.screenElement.parentElement.removeChild(testSupport.screenElement);
});
});
- EM_ASM({ testSupport.qtAddContainerElement(testSupport.screenElement); });
+ EM_ASM({ testSupport.qtSetContainerElements([testSupport.screenElement]); });
}
template<class T>