From 17512700761372e84637f3695a973cab3f78dd61 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 10 Apr 2019 12:44:06 +0200 Subject: [PATCH] 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 --- tests/auto/wayland/xdgshell/tst_xdgshell.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp index dc463e38f63..9b18abdc30d 100644 --- a/tests/auto/wayland/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/wayland/xdgshell/tst_xdgshell.cpp @@ -423,9 +423,16 @@ void tst_xdgshell::switchPopups() void tst_xdgshell::pongs() { - QSignalSpy pongSpy(exec([=] { return get(); }), &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()->resourceMap().size(), 1); + + QSignalSpy pongSpy(exec([=] { return get(); }), &XdgWmBase::pong); const uint serial = exec([=] { return nextSerial(); }); exec([=] { auto *base = get();