summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2022-11-30 12:20:48 +0100
committerMikolaj Boc <mikolaj.boc@qt.io>2022-12-07 14:03:03 +0100
commit6d780fa0aba2d53379c51c8c7439def8fad781aa (patch)
treeb2837bd1e04661a47d4e60440d99bd756317d29d /tests/manual
parent2f22a6e465ebcd31f8385cdab147775f3ea8eb8f (diff)
Fix the qwasmcompositor_main test
This got broken with the introduction of the compositor patch. Change-Id: I7d85795eb537449855a4cce3c8b6b031095c3f7f Reviewed-by: David Skoland <david.skoland@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp b/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
index 17ab7a90e8..8b5807a8dd 100644
--- a/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
+++ b/tests/manual/wasm/qstdweb/qwasmcompositor_main.cpp
@@ -112,19 +112,18 @@ private:
void init()
{
EM_ASM({
- const canvas = document.createElement("canvas");
- canvas.id = "test-canvas-qwasmcompositor";
- testSupport.canvas = canvas;
- document.body.appendChild(canvas);
+ testSupport.screenElement = document.createElement("div");
+ testSupport.screenElement.id = "test-canvas-qwasmcompositor";
+ document.body.appendChild(testSupport.screenElement);
});
m_cleanup.emplace_back([]() mutable {
EM_ASM({
- testSupport.qtRemoveContainerElement(testSupport.canvas);
- testSupport.canvas.parentElement.removeChild(testSupport.canvas);
+ testSupport.qtRemoveContainerElement(testSupport.screenElement);
+ testSupport.screenElement.parentElement.removeChild(testSupport.screenElement);
});
});
- EM_ASM({ testSupport.qtAddContainerElement(testSupport.canvas); });
+ EM_ASM({ testSupport.qtAddContainerElement(testSupport.screenElement); });
}
template<class T>
@@ -158,7 +157,10 @@ void QWasmCompositorTest::testReceivingKeyboardEventsAfterOpenGLContextReset()
QObject::connect(window, &Window::initFailed,
[]() { QWASMFAIL("Cannot initialize test window"); });
QObject::connect(window, &Window::exposed, []() {
- EM_ASM({ testSupport.canvas.dispatchEvent(new KeyboardEvent('keydown', { key : 'a' })); });
+ EM_ASM({
+ testSupport.screenElement.shadowRoot.querySelector('.qt-window')
+ .dispatchEvent(new KeyboardEvent('keydown', { key : 'a' }));
+ });
});
}