From ee785db147f7763b36c99bb79487f3672aea382b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 23 May 2016 11:19:29 +0200 Subject: [PATCH] [autotests/wayland] Try to make PointerInputTest::testMouseActionActiveWindow more robust It's currently failing on build.kde.org. I'm not able to reproduce the failure localy so I can only interpret the failure. The failure looks like a window is still present in the next executed test case thus breaking the positioning. This change ensures that the window is properly gone before going into the next test case. --- autotests/wayland/pointer_input.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autotests/wayland/pointer_input.cpp b/autotests/wayland/pointer_input.cpp index 075fa477fa..95c41e0632 100644 --- a/autotests/wayland/pointer_input.cpp +++ b/autotests/wayland/pointer_input.cpp @@ -740,6 +740,8 @@ void PointerInputTest::testMouseActionActiveWindow() QVERIFY(clientAddedSpy.wait()); AbstractClient *window1 = workspace()->activeClient(); QVERIFY(window1); + QSignalSpy window1DestroyedSpy(window1, &QObject::destroyed); + QVERIFY(window1DestroyedSpy.isValid()); Surface *surface2 = m_compositor->createSurface(m_compositor); QVERIFY(surface2); ShellSurface *shellSurface2 = m_shell->createSurface(surface2, surface2); @@ -749,6 +751,8 @@ void PointerInputTest::testMouseActionActiveWindow() AbstractClient *window2 = workspace()->activeClient(); QVERIFY(window2); QVERIFY(window1 != window2); + QSignalSpy window2DestroyedSpy(window2, &QObject::destroyed); + QVERIFY(window2DestroyedSpy.isValid()); QCOMPARE(workspace()->topClientOnDesktop(1, -1), window2); // geometry of the two windows should be overlapping QVERIFY(window1->geometry().intersects(window2->geometry())); @@ -781,6 +785,11 @@ void PointerInputTest::testMouseActionActiveWindow() // release again waylandServer()->backend()->pointerButtonReleased(button, timestamp++); + + delete surface1; + QVERIFY(window1DestroyedSpy.wait()); + delete surface2; + QVERIFY(window2DestroyedSpy.wait()); } void PointerInputTest::testCursorImage()