From dee97068fb4dd3839e898b6d369bb34d2b468fd0 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 7 Oct 2021 23:11:41 +0300 Subject: [PATCH] autotests: Stabilize testXdgShellClient Currently, testXdgWindowReactive() is a bit flaky because the parent window and the popup window are created together. The popup can be configured again if its global position changes after the parent window has been placed. In order to stabilize the test, create the parent window, then the popup window. --- autotests/integration/xdgshellclient_test.cpp | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp index c00e4ebb2d..7e72f83fc4 100644 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -114,15 +114,13 @@ void TestXdgShellClient::testXdgWindowReactive() positioner->set_reactive(); QScopedPointer rootSurface(Test::createSurface()); - QScopedPointer childSurface(Test::createSurface()); - QScopedPointer root(Test::createXdgToplevelSurface(rootSurface.data())); - QScopedPointer popup(Test::createXdgPopupSurface(childSurface.data(), root->xdgSurface(), positioner.data())); - auto rootClient = Test::renderAndWaitForShown(rootSurface.data(), QSize(100, 100), Qt::cyan); - auto childClient = Test::renderAndWaitForShown(childSurface.data(), QSize(10, 10), Qt::cyan); - QVERIFY(rootClient); + + QScopedPointer childSurface(Test::createSurface()); + QScopedPointer popup(Test::createXdgPopupSurface(childSurface.data(), root->xdgSurface(), positioner.data())); + auto childClient = Test::renderAndWaitForShown(childSurface.data(), QSize(10, 10), Qt::cyan); QVERIFY(childClient); QSignalSpy popupConfigureRequested(popup.data(), &Test::XdgPopup::configureRequested); @@ -145,15 +143,13 @@ void TestXdgShellClient::testXdgWindowRepositioning() otherPositioner->set_anchor_rect(10, 10, 10, 10); QScopedPointer rootSurface(Test::createSurface()); - QScopedPointer childSurface(Test::createSurface()); - QScopedPointer root(Test::createXdgToplevelSurface(rootSurface.data())); - QScopedPointer popup(Test::createXdgPopupSurface(childSurface.data(), root->xdgSurface(), positioner.data())); - auto rootClient = Test::renderAndWaitForShown(rootSurface.data(), QSize(100, 100), Qt::cyan); - auto childClient = Test::renderAndWaitForShown(childSurface.data(), QSize(10, 10), Qt::cyan); - QVERIFY(rootClient); + + QScopedPointer childSurface(Test::createSurface()); + QScopedPointer popup(Test::createXdgPopupSurface(childSurface.data(), root->xdgSurface(), positioner.data())); + auto childClient = Test::renderAndWaitForShown(childSurface.data(), QSize(10, 10), Qt::cyan); QVERIFY(childClient); QSignalSpy reconfigureSpy(popup.data(), &Test::XdgPopup::configureRequested);