diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-04-10 12:44:06 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2019-04-11 13:59:10 +0000 |
commit | 1b773df93f5bccb6b616d2a228cb15cffe8e32d5 (patch) | |
tree | f64c2373fa18e88308eb3c9265d15d569e04d8f9 | |
parent | 3f40adc92f5eefed7860a09ddbbc1eae07ba1de6 (diff) | |
download | qtwayland-1b773df93f5bccb6b616d2a228cb15cffe8e32d5.tar.gz |
Client tests: Fix tst_xdgShell::pongs when run as the only test
The shell integration is initialized lazily, so it's not possible to send ping
events to the client before the first window has been initialized.
This adds a simple window to the pong test.
Change-Id: I13b4a9cb802b7abe18bfc23cf8c75eb873ded3ca
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r-- | tests/auto/client/xdgshell/tst_xdgshell.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index dc463e38..9b18abdc 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -423,9 +423,16 @@ void tst_xdgshell::switchPopups() void tst_xdgshell::pongs() { - QSignalSpy pongSpy(exec([=] { return get<XdgWmBase>(); }), &XdgWmBase::pong); + // Create and show a window to trigger shell integration initialzation, + // otherwise we don't have anything to send ping events to. + QRasterWindow window; + window.resize(200, 200); + window.show(); + // Verify that the client has bound to the global QCOMPOSITOR_TRY_COMPARE(get<XdgWmBase>()->resourceMap().size(), 1); + + QSignalSpy pongSpy(exec([=] { return get<XdgWmBase>(); }), &XdgWmBase::pong); const uint serial = exec([=] { return nextSerial(); }); exec([=] { auto *base = get<XdgWmBase>(); |