From 6dbc060596682aaf385ca132b18dbf2af1871ce0 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 2 Sep 2020 12:44:53 +0300 Subject: [PATCH] autotests: Use new xdg-shell helpers in ToplevelOpenCloseAnimationTest --- .../toplevel_open_close_animation_test.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/autotests/integration/effects/toplevel_open_close_animation_test.cpp b/autotests/integration/effects/toplevel_open_close_animation_test.cpp index 104b9f79a9..54af9f9a59 100644 --- a/autotests/integration/effects/toplevel_open_close_animation_test.cpp +++ b/autotests/integration/effects/toplevel_open_close_animation_test.cpp @@ -22,7 +22,6 @@ #include "effect_builtins.h" #include -#include using namespace KWin; @@ -122,7 +121,7 @@ void ToplevelOpenCloseAnimationTest::testAnimateToplevels() using namespace KWayland::Client; QScopedPointer surface(Test::createSurface()); QVERIFY(!surface.isNull()); - QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); + QScopedPointer shellSurface(Test::createXdgToplevelSurface(surface.data())); QVERIFY(!shellSurface.isNull()); AbstractClient *client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); @@ -166,7 +165,7 @@ void ToplevelOpenCloseAnimationTest::testDontAnimatePopups() using namespace KWayland::Client; QScopedPointer mainWindowSurface(Test::createSurface()); QVERIFY(!mainWindowSurface.isNull()); - QScopedPointer mainWindowShellSurface(Test::createXdgShellStableSurface(mainWindowSurface.data())); + QScopedPointer mainWindowShellSurface(Test::createXdgToplevelSurface(mainWindowSurface.data())); QVERIFY(!mainWindowShellSurface.isNull()); AbstractClient *mainWindow = Test::renderAndWaitForShown(mainWindowSurface.data(), QSize(100, 50), Qt::blue); QVERIFY(mainWindow); @@ -183,12 +182,15 @@ void ToplevelOpenCloseAnimationTest::testDontAnimatePopups() // Create a popup, it should not be animated. QScopedPointer popupSurface(Test::createSurface()); QVERIFY(!popupSurface.isNull()); - XdgPositioner positioner(QSize(20, 20), QRect(0, 0, 10, 10)); - positioner.setGravity(Qt::BottomEdge | Qt::RightEdge); - positioner.setAnchorEdge(Qt::BottomEdge | Qt::LeftEdge); - QScopedPointer popupShellSurface(Test::createXdgShellStablePopup(popupSurface.data(), mainWindowShellSurface.data(), positioner)); + QScopedPointer positioner(Test::createXdgPositioner()); + QVERIFY(positioner); + positioner->set_size(20, 20); + positioner->set_anchor_rect(0, 0, 10, 10); + positioner->set_gravity(Test::XdgPositioner::gravity_bottom_right); + positioner->set_anchor(Test::XdgPositioner::anchor_bottom_left); + QScopedPointer popupShellSurface(Test::createXdgPopupSurface(popupSurface.data(), mainWindowShellSurface->xdgSurface(), positioner.data())); QVERIFY(!popupShellSurface.isNull()); - AbstractClient *popup = Test::renderAndWaitForShown(popupSurface.data(), positioner.initialSize(), Qt::red); + AbstractClient *popup = Test::renderAndWaitForShown(popupSurface.data(), QSize(20, 20), Qt::red); QVERIFY(popup); QVERIFY(popup->isPopupWindow()); QCOMPARE(popup->transientFor(), mainWindow);