From 3f40adc92f5eefed7860a09ddbbc1eae07ba1de6 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 10 Apr 2019 12:47:40 +0200 Subject: tst_xdgshell::showMinimized: Really make sure the window was created The surface(), may be a leftover cursor surface from earlier tests. Check for an xdgSurface instead, as those are verified to be cleaned up between tests. Change-Id: I6a2b402130814e896d335787fcb90fd8d57cafb7 Reviewed-by: Paul Olav Tvete --- tests/auto/client/xdgshell/tst_xdgshell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/client/xdgshell') diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index 6efffc8a4..dc463e38f 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -62,7 +62,7 @@ void tst_xdgshell::showMinimized() // Make sure the window on the compositor side is/was created here, and not after the test // finishes, as that may mess up for later tests. - QCOMPOSITOR_TRY_VERIFY(surface()); + QCOMPOSITOR_TRY_VERIFY(xdgSurface()); QVERIFY(!window.isExposed()); } -- cgit v1.2.3 From 1b773df93f5bccb6b616d2a228cb15cffe8e32d5 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Wed, 10 Apr 2019 12:44:06 +0200 Subject: 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/client/xdgshell/tst_xdgshell.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/auto/client/xdgshell') diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index dc463e38f..9b18abdc3 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::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(); -- cgit v1.2.3