From 3805f212ecec16958ea54e61f5da2f2abbc3ed2e Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 9 Sep 2020 12:54:44 +0300 Subject: [PATCH] autotests: Remove XdgShellSurfaceType enum Currently, it has only one item - XdgShellStable. --- autotests/integration/dbus_interface_test.cpp | 11 +- autotests/integration/debug_console_test.cpp | 11 +- .../integration/decoration_input_test.cpp | 193 +++--- .../dont_crash_cursor_physical_size_empty.cpp | 11 +- .../integration/dont_crash_no_border.cpp | 11 +- .../effects/maximize_animation_test.cpp | 11 +- .../integration/idle_inhibition_test.cpp | 11 +- .../integration/input_stacking_order.cpp | 13 +- autotests/integration/kwin_wayland_test.h | 10 - .../integration/move_resize_window_test.cpp | 11 +- autotests/integration/plasma_surface_test.cpp | 23 +- .../integration/pointer_constraints_test.cpp | 36 +- autotests/integration/scene_qpainter_test.cpp | 22 +- autotests/integration/test_helpers.cpp | 10 - .../integration/virtual_desktop_test.cpp | 33 +- .../integration/xdgshellclient_rules_test.cpp | 553 ++++-------------- autotests/integration/xdgshellclient_test.cpp | 145 +---- 17 files changed, 237 insertions(+), 878 deletions(-) diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index d7f8d54d58..316c2795d0 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -47,7 +47,6 @@ private Q_SLOTS: void cleanup(); void testGetWindowInfoInvalidUuid(); - void testGetWindowInfoXdgShellClient_data(); void testGetWindowInfoXdgShellClient(); void testGetWindowInfoX11Client(); }; @@ -97,21 +96,13 @@ void TestDbusInterface::testGetWindowInfoInvalidUuid() QVERIFY(windowData.empty()); } -void TestDbusInterface::testGetWindowInfoXdgShellClient_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestDbusInterface::testGetWindowInfoXdgShellClient() { QSignalSpy clientAddedSpy(workspace(), &Workspace::clientAdded); QVERIFY(clientAddedSpy.isValid()); QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); shellSurface->setAppId(QByteArrayLiteral("org.kde.foo")); shellSurface->setTitle(QStringLiteral("Test window")); diff --git a/autotests/integration/debug_console_test.cpp b/autotests/integration/debug_console_test.cpp index 3587261ecc..1f938f06d7 100644 --- a/autotests/integration/debug_console_test.cpp +++ b/autotests/integration/debug_console_test.cpp @@ -39,7 +39,6 @@ private Q_SLOTS: void topLevelTest(); void testX11Client(); void testX11Unmanaged(); - void testWaylandClient_data(); void testWaylandClient(); void testInternalWindow(); void testClosingDebugConsole(); @@ -284,13 +283,6 @@ void DebugConsoleTest::testX11Unmanaged() QVERIFY(!model2.hasChildren(model2.index(1, 0, QModelIndex()))); } -void DebugConsoleTest::testWaylandClient_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void DebugConsoleTest::testWaylandClient() { DebugConsoleModel model; @@ -317,8 +309,7 @@ void DebugConsoleTest::testWaylandClient() using namespace KWayland::Client; QScopedPointer surface(Test::createSurface()); QVERIFY(surface->isValid()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); Test::render(surface.data(), QSize(10, 10), Qt::red); diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp index 902dc41c2b..dd2d9f0830 100644 --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -57,7 +57,6 @@ private Q_SLOTS: void testDoubleClick(); void testDoubleTap_data(); void testDoubleTap(); - void testHover_data(); void testHover(); void testPressToMove_data(); void testPressToMove(); @@ -69,13 +68,11 @@ private Q_SLOTS: void testModifierClickUnrestrictedMove(); void testModifierScrollOpacity_data(); void testModifierScrollOpacity(); - void testTouchEvents_data(); void testTouchEvents(); - void testTooltipDoesntEatKeyEvents_data(); void testTooltipDoesntEatKeyEvents(); private: - AbstractClient *showWindow(Test::XdgShellSurfaceType type); + AbstractClient *showWindow(); }; #define MOTION(target) \ @@ -87,7 +84,7 @@ private: #define RELEASE \ kwinApp()->platform()->pointerButtonReleased(BTN_LEFT, timestamp++) -AbstractClient *DecorationInputTest::showWindow(Test::XdgShellSurfaceType type) +AbstractClient *DecorationInputTest::showWindow() { using namespace KWayland::Client; #define VERIFY(statement) \ @@ -99,7 +96,7 @@ AbstractClient *DecorationInputTest::showWindow(Test::XdgShellSurfaceType type) Surface *surface = Test::createSurface(Test::waylandCompositor()); VERIFY(surface); - XdgShellSurface *shellSurface = Test::createXdgShellSurface(type, surface, surface); + XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface); VERIFY(shellSurface); auto deco = Test::waylandServerSideDecoration()->create(surface, surface); QSignalSpy decoSpy(deco, &ServerSideDecoration::modeChanged); @@ -166,17 +163,15 @@ void DecorationInputTest::testAxis_data() { QTest::addColumn("decoPoint"); QTest::addColumn("expectedSection"); - QTest::addColumn("type"); - QTest::newRow("topLeft|xdgWmBase") << QPoint(0, 0) << Qt::TopLeftSection << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("top|xdgWmBase") << QPoint(250, 0) << Qt::TopSection << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("topRight|xdgWmBase") << QPoint(499, 0) << Qt::TopRightSection << Test::XdgShellSurfaceType::XdgShellStable; + QTest::newRow("topLeft") << QPoint(0, 0) << Qt::TopLeftSection; + QTest::newRow("top") << QPoint(250, 0) << Qt::TopSection; + QTest::newRow("topRight") << QPoint(499, 0) << Qt::TopRightSection; } void DecorationInputTest::testAxis() { - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -217,17 +212,15 @@ void DecorationInputTest::testDoubleClick_data() { QTest::addColumn("decoPoint"); QTest::addColumn("expectedSection"); - QTest::addColumn("type"); - QTest::newRow("topLeft|xdgWmBase") << QPoint(0, 0) << Qt::TopLeftSection << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("top|xdgWmBase") << QPoint(250, 0) << Qt::TopSection << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("topRight|xdgWmBase") << QPoint(499, 0) << Qt::TopRightSection << Test::XdgShellSurfaceType::XdgShellStable; + QTest::newRow("topLeft") << QPoint(0, 0) << Qt::TopLeftSection; + QTest::newRow("top") << QPoint(250, 0) << Qt::TopSection; + QTest::newRow("topRight") << QPoint(499, 0) << Qt::TopRightSection; } void KWin::DecorationInputTest::testDoubleClick() { - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -269,17 +262,15 @@ void DecorationInputTest::testDoubleTap_data() { QTest::addColumn("decoPoint"); QTest::addColumn("expectedSection"); - QTest::addColumn("type"); - QTest::newRow("topLeft|xdgWmBase") << QPoint(10, 10) << Qt::TopLeftSection << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("top|xdgWmBase") << QPoint(260, 10) << Qt::TopSection << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("topRight|xdgWmBase") << QPoint(509, 10) << Qt::TopRightSection << Test::XdgShellSurfaceType::XdgShellStable; + QTest::newRow("topLeft") << QPoint(10, 10) << Qt::TopLeftSection; + QTest::newRow("top") << QPoint(260, 10) << Qt::TopSection; + QTest::newRow("topRight") << QPoint(509, 10) << Qt::TopRightSection; } void KWin::DecorationInputTest::testDoubleTap() { - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -319,17 +310,9 @@ void KWin::DecorationInputTest::testDoubleTap() QVERIFY(c->isOnAllDesktops()); } -void DecorationInputTest::testHover_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void DecorationInputTest::testHover() { - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -379,18 +362,16 @@ void DecorationInputTest::testPressToMove_data() QTest::addColumn("offset"); QTest::addColumn("offset2"); QTest::addColumn("offset3"); - QTest::addColumn("type"); - QTest::newRow("To right|xdgWmBase") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("To left|xdgWmBase") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("To bottom|xdgWmBase") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("To top|xdgWmBase") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::XdgShellSurfaceType::XdgShellStable; + QTest::newRow("To right") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0); + QTest::newRow("To left") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0); + QTest::newRow("To bottom") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30); + QTest::newRow("To top") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30); } void DecorationInputTest::testPressToMove() { - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -440,18 +421,16 @@ void DecorationInputTest::testTapToMove_data() QTest::addColumn("offset"); QTest::addColumn("offset2"); QTest::addColumn("offset3"); - QTest::addColumn("type"); - QTest::newRow("To right|xdgWmBase") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0) << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("To left|xdgWmBase") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0) << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("To bottom|xdgWmBase") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30) << Test::XdgShellSurfaceType::XdgShellStable; - QTest::newRow("To top|xdgWmBase") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30) << Test::XdgShellSurfaceType::XdgShellStable; + QTest::newRow("To right") << QPoint(10, 0) << QPoint(20, 0) << QPoint(30, 0); + QTest::newRow("To left") << QPoint(-10, 0) << QPoint(-20, 0) << QPoint(-30, 0); + QTest::newRow("To bottom") << QPoint(0, 10) << QPoint(0, 20) << QPoint(0, 30); + QTest::newRow("To top") << QPoint(0, -10) << QPoint(0, -20) << QPoint(0, -30); } void DecorationInputTest::testTapToMove() { - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -499,13 +478,12 @@ void DecorationInputTest::testTapToMove() void DecorationInputTest::testResizeOutsideWindow_data() { - QTest::addColumn("type"); QTest::addColumn("edge"); QTest::addColumn("expectedCursor"); - QTest::newRow("xdgWmBase - left") << Test::XdgShellSurfaceType::XdgShellStable << Qt::LeftEdge << Qt::SizeHorCursor; - QTest::newRow("xdgWmBase - right") << Test::XdgShellSurfaceType::XdgShellStable << Qt::RightEdge << Qt::SizeHorCursor; - QTest::newRow("xdgWmBase - bottom") << Test::XdgShellSurfaceType::XdgShellStable << Qt::BottomEdge << Qt::SizeVerCursor; + QTest::newRow("left") << Qt::LeftEdge << Qt::SizeHorCursor; + QTest::newRow("right") << Qt::RightEdge << Qt::SizeHorCursor; + QTest::newRow("bottom") << Qt::BottomEdge << Qt::SizeVerCursor; } void DecorationInputTest::testResizeOutsideWindow() @@ -518,8 +496,7 @@ void DecorationInputTest::testResizeOutsideWindow() workspace()->slotReconfigure(); // now create window - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -563,45 +540,38 @@ void DecorationInputTest::testModifierClickUnrestrictedMove_data() QTest::addColumn("mouseButton"); QTest::addColumn("modKey"); QTest::addColumn("capsLock"); - QTest::addColumn("surfaceType"); const QString alt = QStringLiteral("Alt"); const QString meta = QStringLiteral("Meta"); - const QVector> surfaceTypes{ - { Test::XdgShellSurfaceType::XdgShellStable, QByteArrayLiteral("XdgWmBase") }, - }; + QTest::newRow("Left Alt + Left Click") << KEY_LEFTALT << BTN_LEFT << alt << false; + QTest::newRow("Left Alt + Right Click") << KEY_LEFTALT << BTN_RIGHT << alt << false; + QTest::newRow("Left Alt + Middle Click") << KEY_LEFTALT << BTN_MIDDLE << alt << false; + QTest::newRow("Right Alt + Left Click") << KEY_RIGHTALT << BTN_LEFT << alt << false; + QTest::newRow("Right Alt + Right Click") << KEY_RIGHTALT << BTN_RIGHT << alt << false; + QTest::newRow("Right Alt + Middle Click") << KEY_RIGHTALT << BTN_MIDDLE << alt << false; + // now everything with meta + QTest::newRow("Left Meta + Left Click") << KEY_LEFTMETA << BTN_LEFT << meta << false; + QTest::newRow("Left Meta + Right Click") << KEY_LEFTMETA << BTN_RIGHT << meta << false; + QTest::newRow("Left Meta + Middle Click") << KEY_LEFTMETA << BTN_MIDDLE << meta << false; + QTest::newRow("Right Meta + Left Click") << KEY_RIGHTMETA << BTN_LEFT << meta << false; + QTest::newRow("Right Meta + Right Click") << KEY_RIGHTMETA << BTN_RIGHT << meta << false; + QTest::newRow("Right Meta + Middle Click") << KEY_RIGHTMETA << BTN_MIDDLE << meta << false; - for (const auto &type : surfaceTypes) { - QTest::newRow("Left Alt + Left Click" + type.second) << KEY_LEFTALT << BTN_LEFT << alt << false << type.first; - QTest::newRow("Left Alt + Right Click" + type.second) << KEY_LEFTALT << BTN_RIGHT << alt << false << type.first; - QTest::newRow("Left Alt + Middle Click" + type.second) << KEY_LEFTALT << BTN_MIDDLE << alt << false << type.first; - QTest::newRow("Right Alt + Left Click" + type.second) << KEY_RIGHTALT << BTN_LEFT << alt << false << type.first; - QTest::newRow("Right Alt + Right Click" + type.second) << KEY_RIGHTALT << BTN_RIGHT << alt << false << type.first; - QTest::newRow("Right Alt + Middle Click" + type.second) << KEY_RIGHTALT << BTN_MIDDLE << alt << false << type.first; - // now everything with meta - QTest::newRow("Left Meta + Left Click" + type.second) << KEY_LEFTMETA << BTN_LEFT << meta << false << type.first; - QTest::newRow("Left Meta + Right Click" + type.second) << KEY_LEFTMETA << BTN_RIGHT << meta << false << type.first; - QTest::newRow("Left Meta + Middle Click" + type.second) << KEY_LEFTMETA << BTN_MIDDLE << meta << false << type.first; - QTest::newRow("Right Meta + Left Click" + type.second) << KEY_RIGHTMETA << BTN_LEFT << meta << false << type.first; - QTest::newRow("Right Meta + Right Click" + type.second) << KEY_RIGHTMETA << BTN_RIGHT << meta << false << type.first; - QTest::newRow("Right Meta + Middle Click" + type.second) << KEY_RIGHTMETA << BTN_MIDDLE << meta << false << type.first; - - // and with capslock - QTest::newRow("Left Alt + Left Click/CapsLock" + type.second) << KEY_LEFTALT << BTN_LEFT << alt << true << type.first; - QTest::newRow("Left Alt + Right Click/CapsLock" + type.second) << KEY_LEFTALT << BTN_RIGHT << alt << true << type.first; - QTest::newRow("Left Alt + Middle Click/CapsLock" + type.second) << KEY_LEFTALT << BTN_MIDDLE << alt << true << type.first; - QTest::newRow("Right Alt + Left Click/CapsLock" + type.second) << KEY_RIGHTALT << BTN_LEFT << alt << true << type.first; - QTest::newRow("Right Alt + Right Click/CapsLock" + type.second) << KEY_RIGHTALT << BTN_RIGHT << alt << true << type.first; - QTest::newRow("Right Alt + Middle Click/CapsLock" + type.second) << KEY_RIGHTALT << BTN_MIDDLE << alt << true << type.first; - // now everything with meta - QTest::newRow("Left Meta + Left Click/CapsLock" + type.second) << KEY_LEFTMETA << BTN_LEFT << meta << true << type.first; - QTest::newRow("Left Meta + Right Click/CapsLock" + type.second) << KEY_LEFTMETA << BTN_RIGHT << meta << true << type.first; - QTest::newRow("Left Meta + Middle Click/CapsLock" + type.second) << KEY_LEFTMETA << BTN_MIDDLE << meta << true << type.first; - QTest::newRow("Right Meta + Left Click/CapsLock" + type.second) << KEY_RIGHTMETA << BTN_LEFT << meta << true << type.first; - QTest::newRow("Right Meta + Right Click/CapsLock" + type.second) << KEY_RIGHTMETA << BTN_RIGHT << meta << true << type.first; - QTest::newRow("Right Meta + Middle Click/CapsLock" + type.second) << KEY_RIGHTMETA << BTN_MIDDLE << meta << true << type.first; - } + // and with capslock + QTest::newRow("Left Alt + Left Click/CapsLock") << KEY_LEFTALT << BTN_LEFT << alt << true; + QTest::newRow("Left Alt + Right Click/CapsLock") << KEY_LEFTALT << BTN_RIGHT << alt << true; + QTest::newRow("Left Alt + Middle Click/CapsLock") << KEY_LEFTALT << BTN_MIDDLE << alt << true; + QTest::newRow("Right Alt + Left Click/CapsLock") << KEY_RIGHTALT << BTN_LEFT << alt << true; + QTest::newRow("Right Alt + Right Click/CapsLock") << KEY_RIGHTALT << BTN_RIGHT << alt << true; + QTest::newRow("Right Alt + Middle Click/CapsLock") << KEY_RIGHTALT << BTN_MIDDLE << alt << true; + // now everything with meta + QTest::newRow("Left Meta + Left Click/CapsLock") << KEY_LEFTMETA << BTN_LEFT << meta << true; + QTest::newRow("Left Meta + Right Click/CapsLock") << KEY_LEFTMETA << BTN_RIGHT << meta << true; + QTest::newRow("Left Meta + Middle Click/CapsLock") << KEY_LEFTMETA << BTN_MIDDLE << meta << true; + QTest::newRow("Right Meta + Left Click/CapsLock") << KEY_RIGHTMETA << BTN_LEFT << meta << true; + QTest::newRow("Right Meta + Right Click/CapsLock") << KEY_RIGHTMETA << BTN_RIGHT << meta << true; + QTest::newRow("Right Meta + Middle Click/CapsLock") << KEY_RIGHTMETA << BTN_MIDDLE << meta << true; } void DecorationInputTest::testModifierClickUnrestrictedMove() @@ -623,8 +593,7 @@ void DecorationInputTest::testModifierClickUnrestrictedMove() QCOMPARE(options->commandAll3(), Options::MouseUnrestrictedMove); // create a window - QFETCH(Test::XdgShellSurfaceType, surfaceType); - AbstractClient *c = showWindow(surfaceType); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -660,25 +629,18 @@ void DecorationInputTest::testModifierScrollOpacity_data() QTest::addColumn("modifierKey"); QTest::addColumn("modKey"); QTest::addColumn("capsLock"); - QTest::addColumn("surfaceType"); const QString alt = QStringLiteral("Alt"); const QString meta = QStringLiteral("Meta"); - const QVector> surfaceTypes{ - { Test::XdgShellSurfaceType::XdgShellStable, QByteArrayLiteral("XdgWmBase") }, - }; - - for (const auto &type : surfaceTypes) { - QTest::newRow("Left Alt" + type.second) << KEY_LEFTALT << alt << false << type.first; - QTest::newRow("Right Alt" + type.second) << KEY_RIGHTALT << alt << false << type.first; - QTest::newRow("Left Meta" + type.second) << KEY_LEFTMETA << meta << false << type.first; - QTest::newRow("Right Meta" + type.second) << KEY_RIGHTMETA << meta << false << type.first; - QTest::newRow("Left Alt/CapsLock" + type.second) << KEY_LEFTALT << alt << true << type.first; - QTest::newRow("Right Alt/CapsLock" + type.second) << KEY_RIGHTALT << alt << true << type.first; - QTest::newRow("Left Meta/CapsLock" + type.second) << KEY_LEFTMETA << meta << true << type.first; - QTest::newRow("Right Meta/CapsLock" + type.second) << KEY_RIGHTMETA << meta << true << type.first; - } + QTest::newRow("Left Alt") << KEY_LEFTALT << alt << false; + QTest::newRow("Right Alt") << KEY_RIGHTALT << alt << false; + QTest::newRow("Left Meta") << KEY_LEFTMETA << meta << false; + QTest::newRow("Right Meta") << KEY_RIGHTMETA << meta << false; + QTest::newRow("Left Alt/CapsLock") << KEY_LEFTALT << alt << true; + QTest::newRow("Right Alt/CapsLock") << KEY_RIGHTALT << alt << true; + QTest::newRow("Left Meta/CapsLock") << KEY_LEFTMETA << meta << true; + QTest::newRow("Right Meta/CapsLock") << KEY_RIGHTMETA << meta << true; } void DecorationInputTest::testModifierScrollOpacity() @@ -693,8 +655,7 @@ void DecorationInputTest::testModifierScrollOpacity() group.sync(); workspace()->slotReconfigure(); - QFETCH(Test::XdgShellSurfaceType, surfaceType); - AbstractClient *c = showWindow(surfaceType); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -723,13 +684,6 @@ void DecorationInputTest::testModifierScrollOpacity() } } -void DecorationInputTest::testTouchEvents_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - class EventHelper : public QObject { Q_OBJECT @@ -757,8 +711,7 @@ void DecorationInputTest::testTouchEvents() { // this test verifies that the decoration gets a hover leave event on touch release // see BUG 386231 - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); @@ -796,13 +749,6 @@ void DecorationInputTest::testTouchEvents() QCOMPARE(hoverLeaveSpy.count(), 2); } -void DecorationInputTest::testTooltipDoesntEatKeyEvents_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void DecorationInputTest::testTooltipDoesntEatKeyEvents() { // this test verifies that a tooltip on the decoration does not steal key events @@ -814,8 +760,7 @@ void DecorationInputTest::testTooltipDoesntEatKeyEvents() QSignalSpy enteredSpy(keyboard, &KWayland::Client::Keyboard::entered); QVERIFY(enteredSpy.isValid()); - QFETCH(Test::XdgShellSurfaceType, type); - AbstractClient *c = showWindow(type); + AbstractClient *c = showWindow(); QVERIFY(c); QVERIFY(c->isDecorated()); QVERIFY(!c->noBorder()); diff --git a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp index b75567e224..56702f1977 100644 --- a/autotests/integration/dont_crash_cursor_physical_size_empty.cpp +++ b/autotests/integration/dont_crash_cursor_physical_size_empty.cpp @@ -36,7 +36,6 @@ private Q_SLOTS: void init(); void initTestCase(); void cleanup(); - void testMoveCursorOverDeco_data(); void testMoveCursorOverDeco(); }; @@ -73,22 +72,14 @@ void DontCrashCursorPhysicalSizeEmpty::initTestCase() QVERIFY(applicationStartedSpy.wait()); } -void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void DontCrashCursorPhysicalSizeEmpty::testMoveCursorOverDeco() { // This test ensures that there is no endless recursion if the cursor theme cannot be created // a reason for creation failure could be physical size not existing // see BUG: 390314 QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); Test::waylandServerSideDecoration()->create(surface.data(), surface.data()); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); diff --git a/autotests/integration/dont_crash_no_border.cpp b/autotests/integration/dont_crash_no_border.cpp index 8a52134059..50422f5679 100644 --- a/autotests/integration/dont_crash_no_border.cpp +++ b/autotests/integration/dont_crash_no_border.cpp @@ -38,7 +38,6 @@ private Q_SLOTS: void initTestCase(); void init(); void cleanup(); - void testCreateWindow_data(); void testCreateWindow(); }; @@ -84,13 +83,6 @@ void DontCrashNoBorder::cleanup() Test::destroyWaylandConnection(); } -void DontCrashNoBorder::testCreateWindow_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void DontCrashNoBorder::testCreateWindow() { // create a window and ensure that this doesn't crash @@ -98,8 +90,7 @@ void DontCrashNoBorder::testCreateWindow() QScopedPointer surface(Test::createSurface()); QVERIFY(!surface.isNull()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(shellSurface); QScopedPointer deco(Test::waylandServerSideDecoration()->create(surface.data())); QSignalSpy decoSpy(deco.data(), &ServerSideDecoration::modeChanged); diff --git a/autotests/integration/effects/maximize_animation_test.cpp b/autotests/integration/effects/maximize_animation_test.cpp index b41333b07f..0b81e35ae9 100644 --- a/autotests/integration/effects/maximize_animation_test.cpp +++ b/autotests/integration/effects/maximize_animation_test.cpp @@ -36,7 +36,6 @@ private Q_SLOTS: void init(); void cleanup(); - void testMaximizeRestore_data(); void testMaximizeRestore(); }; @@ -82,13 +81,6 @@ void MaximizeAnimationTest::cleanup() Test::destroyWaylandConnection(); } -void MaximizeAnimationTest::testMaximizeRestore_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void MaximizeAnimationTest::testMaximizeRestore() { // This test verifies that the maximize effect animates a client @@ -100,8 +92,7 @@ void MaximizeAnimationTest::testMaximizeRestore() QScopedPointer surface(Test::createSurface()); QVERIFY(!surface.isNull()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(createXdgShellSurface(type, surface.data(), nullptr, Test::CreationSetup::CreateOnly)); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data(), nullptr, Test::CreationSetup::CreateOnly)); // Wait for the initial configure event. XdgShellSurface::States states; diff --git a/autotests/integration/idle_inhibition_test.cpp b/autotests/integration/idle_inhibition_test.cpp index 58aae90a8c..c341f2e170 100644 --- a/autotests/integration/idle_inhibition_test.cpp +++ b/autotests/integration/idle_inhibition_test.cpp @@ -33,7 +33,6 @@ private Q_SLOTS: void init(); void cleanup(); - void testInhibit_data(); void testInhibit(); void testDontInhibitWhenNotOnCurrentDesktop(); void testDontInhibitWhenMinimized(); @@ -70,13 +69,6 @@ void TestIdleInhibition::cleanup() QCOMPARE(VirtualDesktopManager::self()->count(), 1u); } -void TestIdleInhibition::testInhibit_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestIdleInhibition::testInhibit() { auto idle = waylandServer()->display()->findChild(); @@ -87,8 +79,7 @@ void TestIdleInhibition::testInhibit() // now create window QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); // now create inhibition on window QScopedPointer inhibitor(Test::waylandIdleInhibitManager()->createInhibitor(surface.data())); diff --git a/autotests/integration/input_stacking_order.cpp b/autotests/integration/input_stacking_order.cpp index 3309944c99..fa4e3d4916 100644 --- a/autotests/integration/input_stacking_order.cpp +++ b/autotests/integration/input_stacking_order.cpp @@ -40,7 +40,6 @@ private Q_SLOTS: void initTestCase(); void init(); void cleanup(); - void testPointerFocusUpdatesOnStackingOrderChange_data(); void testPointerFocusUpdatesOnStackingOrderChange(); private: @@ -87,13 +86,6 @@ void InputStackingOrderTest::render(KWayland::Client::Surface *surface) Test::flushWaylandConnection(); } -void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange() { // this test creates two windows which overlap @@ -115,8 +107,7 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange() QVERIFY(clientAddedSpy.isValid()); Surface *surface1 = Test::createSurface(Test::waylandCompositor()); QVERIFY(surface1); - QFETCH(Test::XdgShellSurfaceType, type); - XdgShellSurface *shellSurface1 = Test::createXdgShellSurface(type, surface1, surface1); + XdgShellSurface *shellSurface1 = Test::createXdgShellStableSurface(surface1, surface1); QVERIFY(shellSurface1); render(surface1); QVERIFY(clientAddedSpy.wait()); @@ -125,7 +116,7 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange() Surface *surface2 = Test::createSurface(Test::waylandCompositor()); QVERIFY(surface2); - XdgShellSurface *shellSurface2 = Test::createXdgShellSurface(type, surface2, surface2); + XdgShellSurface *shellSurface2 = Test::createXdgShellStableSurface(surface2, surface2); QVERIFY(shellSurface2); render(surface2); QVERIFY(clientAddedSpy.wait()); diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index d8e9631c21..a8e37213f7 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -171,10 +171,6 @@ LayerSurfaceV1 *createLayerSurfaceV1(KWayland::Client::Surface *surface, KWayland::Client::Output *output = nullptr, LayerShellV1::layer layer = LayerShellV1::layer_top); -enum class XdgShellSurfaceType { - XdgShellStable -}; - enum class CreationSetup { CreateOnly, CreateAndConfigure, /// commit and wait for the configure event, making this surface ready to commit buffers @@ -183,11 +179,6 @@ enum class CreationSetup { QtWayland::zwp_input_panel_surface_v1 *createInputPanelSurfaceV1(KWayland::Client::Surface *surface, KWayland::Client::Output *output); -KWayland::Client::XdgShellSurface *createXdgShellSurface(XdgShellSurfaceType type, - KWayland::Client::Surface *surface, - QObject *parent = nullptr, - CreationSetup creationSetup = CreationSetup::CreateAndConfigure); - KWayland::Client::XdgShellSurface *createXdgShellStableSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr, CreationSetup = CreationSetup::CreateAndConfigure); @@ -249,7 +240,6 @@ bool unlockScreen(); } Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::Test::AdditionalWaylandInterfaces) -Q_DECLARE_METATYPE(KWin::Test::XdgShellSurfaceType) #define WAYLANDTEST_MAIN_HELPER(TestObject, DPI, OperationMode) \ int main(int argc, char *argv[]) \ diff --git a/autotests/integration/move_resize_window_test.cpp b/autotests/integration/move_resize_window_test.cpp index 9e559550df..5d1e0d835c 100644 --- a/autotests/integration/move_resize_window_test.cpp +++ b/autotests/integration/move_resize_window_test.cpp @@ -55,7 +55,6 @@ private Q_SLOTS: void testGrowShrink(); void testPointerMoveEnd_data(); void testPointerMoveEnd(); - void testClientSideMove_data(); void testClientSideMove(); void testPlasmaShellSurfaceMovable_data(); void testPlasmaShellSurfaceMovable(); @@ -534,13 +533,6 @@ void MoveResizeWindowTest::testPointerMoveEnd() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(c)); } -void MoveResizeWindowTest::testClientSideMove_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void MoveResizeWindowTest::testClientSideMove() { using namespace KWayland::Client; @@ -554,8 +546,7 @@ void MoveResizeWindowTest::testClientSideMove() QVERIFY(buttonSpy.isValid()); QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); diff --git a/autotests/integration/plasma_surface_test.cpp b/autotests/integration/plasma_surface_test.cpp index cc365faa22..71001b850a 100644 --- a/autotests/integration/plasma_surface_test.cpp +++ b/autotests/integration/plasma_surface_test.cpp @@ -45,7 +45,6 @@ private Q_SLOTS: void testPanelWindowsCanCover_data(); void testPanelWindowsCanCover(); void testOSDPlacement(); - void testOSDPlacementManualPosition_data(); void testOSDPlacementManualPosition(); void testPanelTypeHasStrut_data(); void testPanelTypeHasStrut(); @@ -237,13 +236,6 @@ void PlasmaSurfaceTest::testOSDPlacement() QCOMPARE(c->frameGeometry(), QRect(1280 / 2 - 200 / 2, 2 * 1024 / 3 - 100 / 2, 200, 100)); } -void PlasmaSurfaceTest::testOSDPlacementManualPosition_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void PlasmaSurfaceTest::testOSDPlacementManualPosition() { QScopedPointer surface(Test::createSurface()); @@ -254,8 +246,7 @@ void PlasmaSurfaceTest::testOSDPlacementManualPosition() plasmaSurface->setPosition(QPoint(50, 70)); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); // now render and map the window @@ -271,24 +262,22 @@ void PlasmaSurfaceTest::testOSDPlacementManualPosition() void PlasmaSurfaceTest::testPanelTypeHasStrut_data() { - QTest::addColumn("type"); QTest::addColumn("panelBehavior"); QTest::addColumn("expectedStrut"); QTest::addColumn("expectedMaxArea"); QTest::addColumn("expectedLayer"); - QTest::newRow("always visible - xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable << PlasmaShellSurface::PanelBehavior::AlwaysVisible << true << QRect(0, 50, 1280, 974) << KWin::DockLayer; - QTest::newRow("autohide - xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable << PlasmaShellSurface::PanelBehavior::AutoHide << false << QRect(0, 0, 1280, 1024) << KWin::AboveLayer; - QTest::newRow("windows can cover - xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable << PlasmaShellSurface::PanelBehavior::WindowsCanCover << false << QRect(0, 0, 1280, 1024) << KWin::NormalLayer; - QTest::newRow("windows go below - xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable << PlasmaShellSurface::PanelBehavior::WindowsGoBelow << false << QRect(0, 0, 1280, 1024) << KWin::AboveLayer; + QTest::newRow("always visible - xdgWmBase") << PlasmaShellSurface::PanelBehavior::AlwaysVisible << true << QRect(0, 50, 1280, 974) << KWin::DockLayer; + QTest::newRow("autohide - xdgWmBase") << PlasmaShellSurface::PanelBehavior::AutoHide << false << QRect(0, 0, 1280, 1024) << KWin::AboveLayer; + QTest::newRow("windows can cover - xdgWmBase") << PlasmaShellSurface::PanelBehavior::WindowsCanCover << false << QRect(0, 0, 1280, 1024) << KWin::NormalLayer; + QTest::newRow("windows go below - xdgWmBase") << PlasmaShellSurface::PanelBehavior::WindowsGoBelow << false << QRect(0, 0, 1280, 1024) << KWin::AboveLayer; } void PlasmaSurfaceTest::testPanelTypeHasStrut() { QScopedPointer surface(Test::createSurface()); QVERIFY(!surface.isNull()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(!shellSurface.isNull()); QScopedPointer plasmaSurface(m_plasmaShell->createSurface(surface.data())); QVERIFY(!plasmaSurface.isNull()); diff --git a/autotests/integration/pointer_constraints_test.cpp b/autotests/integration/pointer_constraints_test.cpp index c805573529..bf74998753 100644 --- a/autotests/integration/pointer_constraints_test.cpp +++ b/autotests/integration/pointer_constraints_test.cpp @@ -49,9 +49,7 @@ private Q_SLOTS: void testConfinedPointer_data(); void testConfinedPointer(); - void testLockedPointer_data(); void testLockedPointer(); - void testCloseWindowWithLockedPointer_data(); void testCloseWindowWithLockedPointer(); }; @@ -98,7 +96,6 @@ void TestPointerConstraints::cleanup() void TestPointerConstraints::testConfinedPointer_data() { - QTest::addColumn("type"); QTest::addColumn("positionFunction"); QTest::addColumn("xOffset"); QTest::addColumn("yOffset"); @@ -107,10 +104,10 @@ void TestPointerConstraints::testConfinedPointer_data() PointerFunc topRight = &QRect::topRight; PointerFunc topLeft = &QRect::topLeft; - QTest::newRow("XdgWmBase - bottomLeft") << Test::XdgShellSurfaceType::XdgShellStable << bottomLeft << -1 << 1; - QTest::newRow("XdgWmBase - bottomRight") << Test::XdgShellSurfaceType::XdgShellStable << bottomRight << 1 << 1; - QTest::newRow("XdgWmBase - topLeft") << Test::XdgShellSurfaceType::XdgShellStable << topLeft << -1 << -1; - QTest::newRow("XdgWmBase - topRight") << Test::XdgShellSurfaceType::XdgShellStable << topRight << 1 << -1; + QTest::newRow("XdgWmBase - bottomLeft") << bottomLeft << -1 << 1; + QTest::newRow("XdgWmBase - bottomRight") << bottomRight << 1 << 1; + QTest::newRow("XdgWmBase - topLeft") << topLeft << -1 << -1; + QTest::newRow("XdgWmBase - topRight") << topRight << 1 << -1; } void TestPointerConstraints::testConfinedPointer() @@ -118,8 +115,7 @@ void TestPointerConstraints::testConfinedPointer() // this test sets up a Surface with a confined pointer // simple interaction test to verify that the pointer gets confined QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QScopedPointer pointer(Test::waylandSeat()->createPointer()); QScopedPointer confinedPointer(Test::waylandPointerConstraints()->confinePointer(surface.data(), pointer.data(), nullptr, PointerConstraints::LifeTime::OneShot)); QSignalSpy confinedSpy(confinedPointer.data(), &ConfinedPointer::confined); @@ -226,7 +222,7 @@ void TestPointerConstraints::testConfinedPointer() // create a second window and move it above our constrained window QScopedPointer surface2(Test::createSurface()); - QScopedPointer shellSurface2(Test::createXdgShellSurface(type, surface2.data())); + QScopedPointer shellSurface2(Test::createXdgShellStableSurface(surface2.data())); auto c2 = Test::renderAndWaitForShown(surface2.data(), QSize(1280, 1024), Qt::blue); QVERIFY(c2); QVERIFY(unconfinedSpy2.wait()); @@ -272,21 +268,13 @@ void TestPointerConstraints::testConfinedPointer() QCOMPARE(input()->pointer()->isConstrained(), false); } -void TestPointerConstraints::testLockedPointer_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestPointerConstraints::testLockedPointer() { // this test sets up a Surface with a locked pointer // simple interaction test to verify that the pointer gets locked // the various ways to unlock are not tested as that's already verified by testConfinedPointer QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QScopedPointer pointer(Test::waylandSeat()->createPointer()); QScopedPointer lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.data(), pointer.data(), nullptr, PointerConstraints::LifeTime::OneShot)); QSignalSpy lockedSpy(lockedPointer.data(), &LockedPointer::locked); @@ -348,19 +336,11 @@ void TestPointerConstraints::testLockedPointer() QCOMPARE(KWin::Cursors::self()->mouse()->pos(), c->frameGeometry().center()); } -void TestPointerConstraints::testCloseWindowWithLockedPointer_data() -{ - QTest::addColumn("type"); - - QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestPointerConstraints::testCloseWindowWithLockedPointer() { // test case which verifies that the pointer gets unlocked when the window for it gets closed QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QScopedPointer pointer(Test::waylandSeat()->createPointer()); QScopedPointer lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.data(), pointer.data(), nullptr, PointerConstraints::LifeTime::OneShot)); QSignalSpy lockedSpy(lockedPointer.data(), &LockedPointer::locked); diff --git a/autotests/integration/scene_qpainter_test.cpp b/autotests/integration/scene_qpainter_test.cpp index 3c0a1d10d8..f5434a2534 100644 --- a/autotests/integration/scene_qpainter_test.cpp +++ b/autotests/integration/scene_qpainter_test.cpp @@ -41,10 +41,8 @@ private Q_SLOTS: void cleanup(); void testStartFrame(); void testCursorMoving(); - void testWindow_data(); void testWindow(); void testWindowScaled(); - void testCompositorRestart_data(); void testCompositorRestart(); void testX11Window(); }; @@ -141,13 +139,6 @@ void SceneQPainterTest::testCursorMoving() QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); } -void SceneQPainterTest::testWindow_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void SceneQPainterTest::testWindow() { KWin::Cursors::self()->mouse()->setPos(45, 45); @@ -156,8 +147,7 @@ void SceneQPainterTest::testWindow() QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat)); QVERIFY(Test::waitForWaylandPointer()); QScopedPointer s(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer ss(Test::createXdgShellSurface(type, s.data())); + QScopedPointer ss(Test::createXdgShellStableSurface(s.data())); QScopedPointer p(Test::waylandSeat()->createPointer()); auto scene = KWin::Compositor::self()->scene(); @@ -243,13 +233,6 @@ void SceneQPainterTest::testWindowScaled() QCOMPARE(referenceImage, *scene->qpainterRenderBuffer()); } -void SceneQPainterTest::testCompositorRestart_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void SceneQPainterTest::testCompositorRestart() { // this test verifies that the compositor/SceneQPainter survive a restart of the compositor and still render correctly @@ -259,8 +242,7 @@ void SceneQPainterTest::testCompositorRestart() using namespace KWayland::Client; QVERIFY(Test::setupWaylandConnection()); QScopedPointer s(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer ss(Test::createXdgShellSurface(type, s.data())); + QScopedPointer ss(Test::createXdgShellStableSurface(s.data())); QVERIFY(Test::renderAndWaitForShown(s.data(), QSize(200, 300), Qt::blue)); // now let's try to reinitialize the compositing scene diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index 11d4bd43f8..92d16315f7 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -653,16 +653,6 @@ void initXdgShellPopup(KWayland::Client::Surface *surface, KWayland::Client::Xdg shellPopup->ackConfigure(configureRequestedSpy.last()[1].toInt()); } -KWayland::Client::XdgShellSurface *createXdgShellSurface(XdgShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent, CreationSetup creationSetup) -{ - switch (type) { - case XdgShellSurfaceType::XdgShellStable: - return createXdgShellStableSurface(surface, parent, creationSetup); - default: - return nullptr; - } -} - bool waitForWindowDestroyed(AbstractClient *client) { QSignalSpy destroyedSpy(client, &QObject::destroyed); diff --git a/autotests/integration/virtual_desktop_test.cpp b/autotests/integration/virtual_desktop_test.cpp index 1798c1de6f..5bcff6bfe2 100644 --- a/autotests/integration/virtual_desktop_test.cpp +++ b/autotests/integration/virtual_desktop_test.cpp @@ -30,11 +30,8 @@ private Q_SLOTS: void cleanup(); void testNetCurrentDesktop(); - void testLastDesktopRemoved_data(); void testLastDesktopRemoved(); - void testWindowOnMultipleDesktops_data(); void testWindowOnMultipleDesktops(); - void testRemoveDesktopWithWindow_data(); void testRemoveDesktopWithWindow(); }; @@ -118,13 +115,6 @@ void VirtualDesktopTest::testNetCurrentDesktop() QVERIFY(ok); } -void VirtualDesktopTest::testLastDesktopRemoved_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void VirtualDesktopTest::testLastDesktopRemoved() { // first create a new desktop @@ -138,8 +128,7 @@ void VirtualDesktopTest::testLastDesktopRemoved() // now create a window on this desktop QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); @@ -161,13 +150,6 @@ void VirtualDesktopTest::testLastDesktopRemoved() QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), client->desktops().first()); } -void VirtualDesktopTest::testWindowOnMultipleDesktops_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void VirtualDesktopTest::testWindowOnMultipleDesktops() { // first create two new desktops @@ -181,8 +163,7 @@ void VirtualDesktopTest::testWindowOnMultipleDesktops() // now create a window on this desktop QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); @@ -248,13 +229,6 @@ void VirtualDesktopTest::testWindowOnMultipleDesktops() QCOMPARE(client->desktops().count(), 2u); } -void VirtualDesktopTest::testRemoveDesktopWithWindow_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void VirtualDesktopTest::testRemoveDesktopWithWindow() { // first create two new desktops @@ -268,8 +242,7 @@ void VirtualDesktopTest::testRemoveDesktopWithWindow() // now create a window on this desktop QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto client = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(client); diff --git a/autotests/integration/xdgshellclient_rules_test.cpp b/autotests/integration/xdgshellclient_rules_test.cpp index bfbe2b01d9..be331f5edb 100644 --- a/autotests/integration/xdgshellclient_rules_test.cpp +++ b/autotests/integration/xdgshellclient_rules_test.cpp @@ -38,174 +38,96 @@ private Q_SLOTS: void init(); void cleanup(); - void testPositionDontAffect_data(); void testPositionDontAffect(); - void testPositionApply_data(); void testPositionApply(); - void testPositionRemember_data(); void testPositionRemember(); - void testPositionForce_data(); void testPositionForce(); - void testPositionApplyNow_data(); void testPositionApplyNow(); - void testPositionForceTemporarily_data(); void testPositionForceTemporarily(); - void testSizeDontAffect_data(); void testSizeDontAffect(); - void testSizeApply_data(); void testSizeApply(); - void testSizeRemember_data(); void testSizeRemember(); - void testSizeForce_data(); void testSizeForce(); - void testSizeApplyNow_data(); void testSizeApplyNow(); - void testSizeForceTemporarily_data(); void testSizeForceTemporarily(); - void testMaximizeDontAffect_data(); void testMaximizeDontAffect(); - void testMaximizeApply_data(); void testMaximizeApply(); - void testMaximizeRemember_data(); void testMaximizeRemember(); - void testMaximizeForce_data(); void testMaximizeForce(); - void testMaximizeApplyNow_data(); void testMaximizeApplyNow(); - void testMaximizeForceTemporarily_data(); void testMaximizeForceTemporarily(); - void testDesktopDontAffect_data(); void testDesktopDontAffect(); - void testDesktopApply_data(); void testDesktopApply(); - void testDesktopRemember_data(); void testDesktopRemember(); - void testDesktopForce_data(); void testDesktopForce(); - void testDesktopApplyNow_data(); void testDesktopApplyNow(); - void testDesktopForceTemporarily_data(); void testDesktopForceTemporarily(); - void testMinimizeDontAffect_data(); void testMinimizeDontAffect(); - void testMinimizeApply_data(); void testMinimizeApply(); - void testMinimizeRemember_data(); void testMinimizeRemember(); - void testMinimizeForce_data(); void testMinimizeForce(); - void testMinimizeApplyNow_data(); void testMinimizeApplyNow(); - void testMinimizeForceTemporarily_data(); void testMinimizeForceTemporarily(); - void testSkipTaskbarDontAffect_data(); void testSkipTaskbarDontAffect(); - void testSkipTaskbarApply_data(); void testSkipTaskbarApply(); - void testSkipTaskbarRemember_data(); void testSkipTaskbarRemember(); - void testSkipTaskbarForce_data(); void testSkipTaskbarForce(); - void testSkipTaskbarApplyNow_data(); void testSkipTaskbarApplyNow(); - void testSkipTaskbarForceTemporarily_data(); void testSkipTaskbarForceTemporarily(); - void testSkipPagerDontAffect_data(); void testSkipPagerDontAffect(); - void testSkipPagerApply_data(); void testSkipPagerApply(); - void testSkipPagerRemember_data(); void testSkipPagerRemember(); - void testSkipPagerForce_data(); void testSkipPagerForce(); - void testSkipPagerApplyNow_data(); void testSkipPagerApplyNow(); - void testSkipPagerForceTemporarily_data(); void testSkipPagerForceTemporarily(); - void testSkipSwitcherDontAffect_data(); void testSkipSwitcherDontAffect(); - void testSkipSwitcherApply_data(); void testSkipSwitcherApply(); - void testSkipSwitcherRemember_data(); void testSkipSwitcherRemember(); - void testSkipSwitcherForce_data(); void testSkipSwitcherForce(); - void testSkipSwitcherApplyNow_data(); void testSkipSwitcherApplyNow(); - void testSkipSwitcherForceTemporarily_data(); void testSkipSwitcherForceTemporarily(); - void testKeepAboveDontAffect_data(); void testKeepAboveDontAffect(); - void testKeepAboveApply_data(); void testKeepAboveApply(); - void testKeepAboveRemember_data(); void testKeepAboveRemember(); - void testKeepAboveForce_data(); void testKeepAboveForce(); - void testKeepAboveApplyNow_data(); void testKeepAboveApplyNow(); - void testKeepAboveForceTemporarily_data(); void testKeepAboveForceTemporarily(); - void testKeepBelowDontAffect_data(); void testKeepBelowDontAffect(); - void testKeepBelowApply_data(); void testKeepBelowApply(); - void testKeepBelowRemember_data(); void testKeepBelowRemember(); - void testKeepBelowForce_data(); void testKeepBelowForce(); - void testKeepBelowApplyNow_data(); void testKeepBelowApplyNow(); - void testKeepBelowForceTemporarily_data(); void testKeepBelowForceTemporarily(); - void testShortcutDontAffect_data(); void testShortcutDontAffect(); - void testShortcutApply_data(); void testShortcutApply(); - void testShortcutRemember_data(); void testShortcutRemember(); - void testShortcutForce_data(); void testShortcutForce(); - void testShortcutApplyNow_data(); void testShortcutApplyNow(); - void testShortcutForceTemporarily_data(); void testShortcutForceTemporarily(); - void testDesktopFileDontAffect_data(); void testDesktopFileDontAffect(); - void testDesktopFileApply_data(); void testDesktopFileApply(); - void testDesktopFileRemember_data(); void testDesktopFileRemember(); - void testDesktopFileForce_data(); void testDesktopFileForce(); - void testDesktopFileApplyNow_data(); void testDesktopFileApplyNow(); - void testDesktopFileForceTemporarily_data(); void testDesktopFileForceTemporarily(); - void testActiveOpacityDontAffect_data(); void testActiveOpacityDontAffect(); - void testActiveOpacityForce_data(); void testActiveOpacityForce(); - void testActiveOpacityForceTemporarily_data(); void testActiveOpacityForceTemporarily(); - void testInactiveOpacityDontAffect_data(); void testInactiveOpacityDontAffect(); - void testInactiveOpacityForce_data(); void testInactiveOpacityForce(); - void testInactiveOpacityForceTemporarily_data(); void testInactiveOpacityForceTemporarily(); void testMatchAfterNameChange(); @@ -250,18 +172,11 @@ void TestXdgShellClientRules::cleanup() QCOMPARE(VirtualDesktopManager::self()->count(), 1u); } -#define TEST_DATA(name) \ -void TestXdgShellClientRules::name##_data() \ -{ \ - QTest::addColumn("type"); \ - QTest::newRow("XdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; \ -} - -std::tuple createWindow(Test::XdgShellSurfaceType type, const QByteArray &appId) +std::tuple createWindow(const QByteArray &appId) { // Create an xdg surface. Surface *surface = Test::createSurface(); - XdgShellSurface *shellSurface = Test::createXdgShellSurface(type, surface, surface, Test::CreationSetup::CreateOnly); + XdgShellSurface *shellSurface = Test::createXdgShellStableSurface(surface, surface, Test::CreationSetup::CreateOnly); // Assign the desired app id. shellSurface->setAppId(appId); @@ -278,8 +193,6 @@ std::tuple createWindow(Test::Xd return {client, surface, shellSurface}; } -TEST_DATA(testPositionDontAffect) - void TestXdgShellClientRules::testPositionDontAffect() { // Initialize RuleBook with the test rule. @@ -296,11 +209,10 @@ void TestXdgShellClientRules::testPositionDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -316,8 +228,6 @@ void TestXdgShellClientRules::testPositionDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testPositionApply) - void TestXdgShellClientRules::testPositionApply() { // Initialize RuleBook with the test rule. @@ -334,11 +244,10 @@ void TestXdgShellClientRules::testPositionApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -382,7 +291,7 @@ void TestXdgShellClientRules::testPositionApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMovable()); @@ -395,8 +304,6 @@ void TestXdgShellClientRules::testPositionApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testPositionRemember) - void TestXdgShellClientRules::testPositionRemember() { // Initialize RuleBook with the test rule. @@ -413,11 +320,10 @@ void TestXdgShellClientRules::testPositionRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -461,7 +367,7 @@ void TestXdgShellClientRules::testPositionRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMovable()); @@ -474,8 +380,6 @@ void TestXdgShellClientRules::testPositionRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testPositionForce) - void TestXdgShellClientRules::testPositionForce() { // Initialize RuleBook with the test rule. @@ -492,11 +396,10 @@ void TestXdgShellClientRules::testPositionForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -521,7 +424,7 @@ void TestXdgShellClientRules::testPositionForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(!client->isMovable()); @@ -534,16 +437,13 @@ void TestXdgShellClientRules::testPositionForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testPositionApplyNow) - void TestXdgShellClientRules::testPositionApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; QObject *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -615,8 +515,6 @@ void TestXdgShellClientRules::testPositionApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testPositionForceTemporarily) - void TestXdgShellClientRules::testPositionForceTemporarily() { // Initialize RuleBook with the test rule. @@ -633,11 +531,10 @@ void TestXdgShellClientRules::testPositionForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -662,7 +559,7 @@ void TestXdgShellClientRules::testPositionForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QVERIFY(client->isMovable()); @@ -675,8 +572,6 @@ void TestXdgShellClientRules::testPositionForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSizeDontAffect) - void TestXdgShellClientRules::testSizeDontAffect() { // Initialize RuleBook with the test rule. @@ -693,11 +588,10 @@ void TestXdgShellClientRules::testSizeDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -726,8 +620,6 @@ void TestXdgShellClientRules::testSizeDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSizeApply) - void TestXdgShellClientRules::testSizeApply() { // Initialize RuleBook with the test rule. @@ -744,11 +636,10 @@ void TestXdgShellClientRules::testSizeApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -837,7 +728,7 @@ void TestXdgShellClientRules::testSizeApply() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -862,8 +753,6 @@ void TestXdgShellClientRules::testSizeApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSizeRemember) - void TestXdgShellClientRules::testSizeRemember() { // Initialize RuleBook with the test rule. @@ -880,11 +769,10 @@ void TestXdgShellClientRules::testSizeRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -973,7 +861,7 @@ void TestXdgShellClientRules::testSizeRemember() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -998,8 +886,6 @@ void TestXdgShellClientRules::testSizeRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSizeForce) - void TestXdgShellClientRules::testSizeForce() { // Initialize RuleBook with the test rule. @@ -1016,11 +902,10 @@ void TestXdgShellClientRules::testSizeForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1061,7 +946,7 @@ void TestXdgShellClientRules::testSizeForce() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -1086,16 +971,13 @@ void TestXdgShellClientRules::testSizeForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSizeApplyNow) - void TestXdgShellClientRules::testSizeApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1155,8 +1037,6 @@ void TestXdgShellClientRules::testSizeApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSizeForceTemporarily) - void TestXdgShellClientRules::testSizeForceTemporarily() { // Initialize RuleBook with the test rule. @@ -1173,11 +1053,10 @@ void TestXdgShellClientRules::testSizeForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1218,7 +1097,7 @@ void TestXdgShellClientRules::testSizeForceTemporarily() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -1243,8 +1122,6 @@ void TestXdgShellClientRules::testSizeForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMaximizeDontAffect) - void TestXdgShellClientRules::testMaximizeDontAffect() { // Initialize RuleBook with the test rule. @@ -1263,11 +1140,10 @@ void TestXdgShellClientRules::testMaximizeDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1305,8 +1181,6 @@ void TestXdgShellClientRules::testMaximizeDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMaximizeApply) - void TestXdgShellClientRules::testMaximizeApply() { // Initialize RuleBook with the test rule. @@ -1325,11 +1199,10 @@ void TestXdgShellClientRules::testMaximizeApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1385,7 +1258,7 @@ void TestXdgShellClientRules::testMaximizeApply() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -1418,8 +1291,6 @@ void TestXdgShellClientRules::testMaximizeApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMaximizeRemember) - void TestXdgShellClientRules::testMaximizeRemember() { // Initialize RuleBook with the test rule. @@ -1438,11 +1309,10 @@ void TestXdgShellClientRules::testMaximizeRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1498,7 +1368,7 @@ void TestXdgShellClientRules::testMaximizeRemember() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -1531,8 +1401,6 @@ void TestXdgShellClientRules::testMaximizeRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMaximizeForce) - void TestXdgShellClientRules::testMaximizeForce() { // Initialize RuleBook with the test rule. @@ -1551,11 +1419,10 @@ void TestXdgShellClientRules::testMaximizeForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1600,7 +1467,7 @@ void TestXdgShellClientRules::testMaximizeForce() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -1633,16 +1500,13 @@ void TestXdgShellClientRules::testMaximizeForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMaximizeApplyNow) - void TestXdgShellClientRules::testMaximizeApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1740,8 +1604,6 @@ void TestXdgShellClientRules::testMaximizeApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMaximizeForceTemporarily) - void TestXdgShellClientRules::testMaximizeForceTemporarily() { // Initialize RuleBook with the test rule. @@ -1760,11 +1622,10 @@ void TestXdgShellClientRules::testMaximizeForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); QScopedPointer surface; surface.reset(Test::createSurface()); QScopedPointer shellSurface; - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QScopedPointer configureRequestedSpy; configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); @@ -1809,7 +1670,7 @@ void TestXdgShellClientRules::testMaximizeForceTemporarily() surface.reset(); QVERIFY(Test::waitForWindowDestroyed(client)); surface.reset(Test::createSurface()); - shellSurface.reset(createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + shellSurface.reset(createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); configureRequestedSpy.reset(new QSignalSpy(shellSurface.data(), &XdgShellSurface::configureRequested)); shellSurface->setAppId("org.kde.foo"); surface->commit(Surface::CommitFlag::None); @@ -1842,8 +1703,6 @@ void TestXdgShellClientRules::testMaximizeForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopDontAffect) - void TestXdgShellClientRules::testDesktopDontAffect() { // Initialize RuleBook with the test rule. @@ -1866,11 +1725,10 @@ void TestXdgShellClientRules::testDesktopDontAffect() QCOMPARE(VirtualDesktopManager::self()->current(), 1); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should appear on the current virtual desktop. @@ -1883,8 +1741,6 @@ void TestXdgShellClientRules::testDesktopDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopApply) - void TestXdgShellClientRules::testDesktopApply() { // Initialize RuleBook with the test rule. @@ -1907,11 +1763,10 @@ void TestXdgShellClientRules::testDesktopApply() QCOMPARE(VirtualDesktopManager::self()->current(), 1); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should appear on the second virtual desktop. @@ -1929,7 +1784,7 @@ void TestXdgShellClientRules::testDesktopApply() QVERIFY(Test::waitForWindowDestroyed(client)); VirtualDesktopManager::self()->setCurrent(1); QCOMPARE(VirtualDesktopManager::self()->current(), 1); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->desktop(), 2); QCOMPARE(VirtualDesktopManager::self()->current(), 2); @@ -1940,8 +1795,6 @@ void TestXdgShellClientRules::testDesktopApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopRemember) - void TestXdgShellClientRules::testDesktopRemember() { // Initialize RuleBook with the test rule. @@ -1964,11 +1817,10 @@ void TestXdgShellClientRules::testDesktopRemember() QCOMPARE(VirtualDesktopManager::self()->current(), 1); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->desktop(), 2); QCOMPARE(VirtualDesktopManager::self()->current(), 2); @@ -1982,7 +1834,7 @@ void TestXdgShellClientRules::testDesktopRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->desktop(), 1); QCOMPARE(VirtualDesktopManager::self()->current(), 1); @@ -1993,8 +1845,6 @@ void TestXdgShellClientRules::testDesktopRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopForce) - void TestXdgShellClientRules::testDesktopForce() { // Initialize RuleBook with the test rule. @@ -2017,11 +1867,10 @@ void TestXdgShellClientRules::testDesktopForce() QCOMPARE(VirtualDesktopManager::self()->current(), 1); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should appear on the second virtual desktop. @@ -2039,7 +1888,7 @@ void TestXdgShellClientRules::testDesktopForce() QVERIFY(Test::waitForWindowDestroyed(client)); VirtualDesktopManager::self()->setCurrent(1); QCOMPARE(VirtualDesktopManager::self()->current(), 1); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->desktop(), 2); QCOMPARE(VirtualDesktopManager::self()->current(), 2); @@ -2050,8 +1899,6 @@ void TestXdgShellClientRules::testDesktopForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopApplyNow) - void TestXdgShellClientRules::testDesktopApplyNow() { // We need at least two virtual desktop for this test. @@ -2061,11 +1908,10 @@ void TestXdgShellClientRules::testDesktopApplyNow() QCOMPARE(VirtualDesktopManager::self()->current(), 1); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->desktop(), 1); QCOMPARE(VirtualDesktopManager::self()->current(), 1); @@ -2103,8 +1949,6 @@ void TestXdgShellClientRules::testDesktopApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopForceTemporarily) - void TestXdgShellClientRules::testDesktopForceTemporarily() { // Initialize RuleBook with the test rule. @@ -2127,11 +1971,10 @@ void TestXdgShellClientRules::testDesktopForceTemporarily() QCOMPARE(VirtualDesktopManager::self()->current(), 1); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should appear on the second virtual desktop. @@ -2149,7 +1992,7 @@ void TestXdgShellClientRules::testDesktopForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); VirtualDesktopManager::self()->setCurrent(1); QCOMPARE(VirtualDesktopManager::self()->current(), 1); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->desktop(), 1); QCOMPARE(VirtualDesktopManager::self()->current(), 1); @@ -2168,8 +2011,6 @@ void TestXdgShellClientRules::testDesktopForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMinimizeDontAffect) - void TestXdgShellClientRules::testMinimizeDontAffect() { // Initialize RuleBook with the test rule. @@ -2186,11 +2027,10 @@ void TestXdgShellClientRules::testMinimizeDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); @@ -2203,8 +2043,6 @@ void TestXdgShellClientRules::testMinimizeDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMinimizeApply) - void TestXdgShellClientRules::testMinimizeApply() { // Initialize RuleBook with the test rule. @@ -2221,11 +2059,10 @@ void TestXdgShellClientRules::testMinimizeApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); @@ -2240,7 +2077,7 @@ void TestXdgShellClientRules::testMinimizeApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); QVERIFY(client->isMinimized()); @@ -2251,8 +2088,6 @@ void TestXdgShellClientRules::testMinimizeApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMinimizeRemember) - void TestXdgShellClientRules::testMinimizeRemember() { // Initialize RuleBook with the test rule. @@ -2269,11 +2104,10 @@ void TestXdgShellClientRules::testMinimizeRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); QVERIFY(!client->isMinimized()); @@ -2286,7 +2120,7 @@ void TestXdgShellClientRules::testMinimizeRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); QVERIFY(client->isMinimized()); @@ -2297,8 +2131,6 @@ void TestXdgShellClientRules::testMinimizeRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMinimizeForce) - void TestXdgShellClientRules::testMinimizeForce() { // Initialize RuleBook with the test rule. @@ -2315,11 +2147,10 @@ void TestXdgShellClientRules::testMinimizeForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->isMinimizable()); QVERIFY(!client->isMinimized()); @@ -2332,7 +2163,7 @@ void TestXdgShellClientRules::testMinimizeForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->isMinimizable()); QVERIFY(!client->isMinimized()); @@ -2345,16 +2176,13 @@ void TestXdgShellClientRules::testMinimizeForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMinimizeApplyNow) - void TestXdgShellClientRules::testMinimizeApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); QVERIFY(!client->isMinimized()); @@ -2391,8 +2219,6 @@ void TestXdgShellClientRules::testMinimizeApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testMinimizeForceTemporarily) - void TestXdgShellClientRules::testMinimizeForceTemporarily() { // Initialize RuleBook with the test rule. @@ -2409,11 +2235,10 @@ void TestXdgShellClientRules::testMinimizeForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->isMinimizable()); QVERIFY(!client->isMinimized()); @@ -2426,7 +2251,7 @@ void TestXdgShellClientRules::testMinimizeForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isMinimizable()); QVERIFY(!client->isMinimized()); @@ -2439,8 +2264,6 @@ void TestXdgShellClientRules::testMinimizeForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipTaskbarDontAffect) - void TestXdgShellClientRules::testSkipTaskbarDontAffect() { // Initialize RuleBook with the test rule. @@ -2457,11 +2280,10 @@ void TestXdgShellClientRules::testSkipTaskbarDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be affected by the rule. @@ -2473,8 +2295,6 @@ void TestXdgShellClientRules::testSkipTaskbarDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipTaskbarApply) - void TestXdgShellClientRules::testSkipTaskbarApply() { // Initialize RuleBook with the test rule. @@ -2491,11 +2311,10 @@ void TestXdgShellClientRules::testSkipTaskbarApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a taskbar. @@ -2509,7 +2328,7 @@ void TestXdgShellClientRules::testSkipTaskbarApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->skipTaskbar()); @@ -2519,8 +2338,6 @@ void TestXdgShellClientRules::testSkipTaskbarApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipTaskbarRemember) - void TestXdgShellClientRules::testSkipTaskbarRemember() { // Initialize RuleBook with the test rule. @@ -2537,11 +2354,10 @@ void TestXdgShellClientRules::testSkipTaskbarRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a taskbar. @@ -2555,7 +2371,7 @@ void TestXdgShellClientRules::testSkipTaskbarRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be included on a taskbar. @@ -2567,8 +2383,6 @@ void TestXdgShellClientRules::testSkipTaskbarRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipTaskbarForce) - void TestXdgShellClientRules::testSkipTaskbarForce() { // Initialize RuleBook with the test rule. @@ -2585,11 +2399,10 @@ void TestXdgShellClientRules::testSkipTaskbarForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a taskbar. @@ -2603,7 +2416,7 @@ void TestXdgShellClientRules::testSkipTaskbarForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The skip-taskbar state should be still forced. @@ -2615,16 +2428,13 @@ void TestXdgShellClientRules::testSkipTaskbarForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipTaskbarApplyNow) - void TestXdgShellClientRules::testSkipTaskbarApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->skipTaskbar()); @@ -2658,8 +2468,6 @@ void TestXdgShellClientRules::testSkipTaskbarApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipTaskbarForceTemporarily) - void TestXdgShellClientRules::testSkipTaskbarForceTemporarily() { // Initialize RuleBook with the test rule. @@ -2676,11 +2484,10 @@ void TestXdgShellClientRules::testSkipTaskbarForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a taskbar. @@ -2694,7 +2501,7 @@ void TestXdgShellClientRules::testSkipTaskbarForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->skipTaskbar()); @@ -2708,8 +2515,6 @@ void TestXdgShellClientRules::testSkipTaskbarForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipPagerDontAffect) - void TestXdgShellClientRules::testSkipPagerDontAffect() { // Initialize RuleBook with the test rule. @@ -2726,11 +2531,10 @@ void TestXdgShellClientRules::testSkipPagerDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be affected by the rule. @@ -2742,8 +2546,6 @@ void TestXdgShellClientRules::testSkipPagerDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipPagerApply) - void TestXdgShellClientRules::testSkipPagerApply() { // Initialize RuleBook with the test rule. @@ -2760,11 +2562,10 @@ void TestXdgShellClientRules::testSkipPagerApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a pager. @@ -2778,7 +2579,7 @@ void TestXdgShellClientRules::testSkipPagerApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->skipPager()); @@ -2788,8 +2589,6 @@ void TestXdgShellClientRules::testSkipPagerApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipPagerRemember) - void TestXdgShellClientRules::testSkipPagerRemember() { // Initialize RuleBook with the test rule. @@ -2806,11 +2605,10 @@ void TestXdgShellClientRules::testSkipPagerRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a pager. @@ -2824,7 +2622,7 @@ void TestXdgShellClientRules::testSkipPagerRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be included on a pager. @@ -2836,8 +2634,6 @@ void TestXdgShellClientRules::testSkipPagerRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipPagerForce) - void TestXdgShellClientRules::testSkipPagerForce() { // Initialize RuleBook with the test rule. @@ -2854,11 +2650,10 @@ void TestXdgShellClientRules::testSkipPagerForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a pager. @@ -2872,7 +2667,7 @@ void TestXdgShellClientRules::testSkipPagerForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The skip-pager state should be still forced. @@ -2884,16 +2679,13 @@ void TestXdgShellClientRules::testSkipPagerForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipPagerApplyNow) - void TestXdgShellClientRules::testSkipPagerApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->skipPager()); @@ -2927,8 +2719,6 @@ void TestXdgShellClientRules::testSkipPagerApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipPagerForceTemporarily) - void TestXdgShellClientRules::testSkipPagerForceTemporarily() { // Initialize RuleBook with the test rule. @@ -2945,11 +2735,10 @@ void TestXdgShellClientRules::testSkipPagerForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be included on a pager. @@ -2963,7 +2752,7 @@ void TestXdgShellClientRules::testSkipPagerForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->skipPager()); @@ -2977,8 +2766,6 @@ void TestXdgShellClientRules::testSkipPagerForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipSwitcherDontAffect) - void TestXdgShellClientRules::testSkipSwitcherDontAffect() { // Initialize RuleBook with the test rule. @@ -2995,11 +2782,10 @@ void TestXdgShellClientRules::testSkipSwitcherDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should not be affected by the rule. @@ -3011,8 +2797,6 @@ void TestXdgShellClientRules::testSkipSwitcherDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipSwitcherApply) - void TestXdgShellClientRules::testSkipSwitcherApply() { // Initialize RuleBook with the test rule. @@ -3029,11 +2813,10 @@ void TestXdgShellClientRules::testSkipSwitcherApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be excluded from window switching effects. @@ -3047,7 +2830,7 @@ void TestXdgShellClientRules::testSkipSwitcherApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->skipSwitcher()); @@ -3057,8 +2840,6 @@ void TestXdgShellClientRules::testSkipSwitcherApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipSwitcherRemember) - void TestXdgShellClientRules::testSkipSwitcherRemember() { // Initialize RuleBook with the test rule. @@ -3075,11 +2856,10 @@ void TestXdgShellClientRules::testSkipSwitcherRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be excluded from window switching effects. @@ -3093,7 +2873,7 @@ void TestXdgShellClientRules::testSkipSwitcherRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be included in window switching effects. @@ -3105,8 +2885,6 @@ void TestXdgShellClientRules::testSkipSwitcherRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipSwitcherForce) - void TestXdgShellClientRules::testSkipSwitcherForce() { // Initialize RuleBook with the test rule. @@ -3123,11 +2901,10 @@ void TestXdgShellClientRules::testSkipSwitcherForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be excluded from window switching effects. @@ -3141,7 +2918,7 @@ void TestXdgShellClientRules::testSkipSwitcherForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The skip-switcher state should be still forced. @@ -3153,16 +2930,13 @@ void TestXdgShellClientRules::testSkipSwitcherForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipSwitcherApplyNow) - void TestXdgShellClientRules::testSkipSwitcherApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->skipSwitcher()); @@ -3196,8 +2970,6 @@ void TestXdgShellClientRules::testSkipSwitcherApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testSkipSwitcherForceTemporarily) - void TestXdgShellClientRules::testSkipSwitcherForceTemporarily() { // Initialize RuleBook with the test rule. @@ -3214,11 +2986,10 @@ void TestXdgShellClientRules::testSkipSwitcherForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The client should be excluded from window switching effects. @@ -3232,7 +3003,7 @@ void TestXdgShellClientRules::testSkipSwitcherForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->skipSwitcher()); @@ -3246,8 +3017,6 @@ void TestXdgShellClientRules::testSkipSwitcherForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepAboveDontAffect) - void TestXdgShellClientRules::testKeepAboveDontAffect() { // Initialize RuleBook with the test rule. @@ -3264,11 +3033,10 @@ void TestXdgShellClientRules::testKeepAboveDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The keep-above state of the client should not be affected by the rule. @@ -3280,8 +3048,6 @@ void TestXdgShellClientRules::testKeepAboveDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepAboveApply) - void TestXdgShellClientRules::testKeepAboveApply() { // Initialize RuleBook with the test rule. @@ -3298,11 +3064,10 @@ void TestXdgShellClientRules::testKeepAboveApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept above. @@ -3316,7 +3081,7 @@ void TestXdgShellClientRules::testKeepAboveApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->keepAbove()); @@ -3326,8 +3091,6 @@ void TestXdgShellClientRules::testKeepAboveApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepAboveRemember) - void TestXdgShellClientRules::testKeepAboveRemember() { // Initialize RuleBook with the test rule. @@ -3344,11 +3107,10 @@ void TestXdgShellClientRules::testKeepAboveRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept above. @@ -3362,7 +3124,7 @@ void TestXdgShellClientRules::testKeepAboveRemember() QVERIFY(Test::waitForWindowDestroyed(client)); // Re-open the client, it should not be kept above. - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->keepAbove()); @@ -3372,8 +3134,6 @@ void TestXdgShellClientRules::testKeepAboveRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepAboveForce) - void TestXdgShellClientRules::testKeepAboveForce() { // Initialize RuleBook with the test rule. @@ -3390,11 +3150,10 @@ void TestXdgShellClientRules::testKeepAboveForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept above. @@ -3408,7 +3167,7 @@ void TestXdgShellClientRules::testKeepAboveForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->keepAbove()); @@ -3418,16 +3177,13 @@ void TestXdgShellClientRules::testKeepAboveForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepAboveApplyNow) - void TestXdgShellClientRules::testKeepAboveApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->keepAbove()); @@ -3461,8 +3217,6 @@ void TestXdgShellClientRules::testKeepAboveApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepAboveForceTemporarily) - void TestXdgShellClientRules::testKeepAboveForceTemporarily() { // Initialize RuleBook with the test rule. @@ -3479,11 +3233,10 @@ void TestXdgShellClientRules::testKeepAboveForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept above. @@ -3497,7 +3250,7 @@ void TestXdgShellClientRules::testKeepAboveForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->keepAbove()); @@ -3513,8 +3266,6 @@ void TestXdgShellClientRules::testKeepAboveForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepBelowDontAffect) - void TestXdgShellClientRules::testKeepBelowDontAffect() { // Initialize RuleBook with the test rule. @@ -3531,11 +3282,10 @@ void TestXdgShellClientRules::testKeepBelowDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The keep-below state of the client should not be affected by the rule. @@ -3547,8 +3297,6 @@ void TestXdgShellClientRules::testKeepBelowDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepBelowApply) - void TestXdgShellClientRules::testKeepBelowApply() { // Initialize RuleBook with the test rule. @@ -3565,11 +3313,10 @@ void TestXdgShellClientRules::testKeepBelowApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept below. @@ -3583,7 +3330,7 @@ void TestXdgShellClientRules::testKeepBelowApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->keepBelow()); @@ -3593,8 +3340,6 @@ void TestXdgShellClientRules::testKeepBelowApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepBelowRemember) - void TestXdgShellClientRules::testKeepBelowRemember() { // Initialize RuleBook with the test rule. @@ -3611,11 +3356,10 @@ void TestXdgShellClientRules::testKeepBelowRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept below. @@ -3629,7 +3373,7 @@ void TestXdgShellClientRules::testKeepBelowRemember() QVERIFY(Test::waitForWindowDestroyed(client)); // Re-open the client, it should not be kept below. - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->keepBelow()); @@ -3639,8 +3383,6 @@ void TestXdgShellClientRules::testKeepBelowRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepBelowForce) - void TestXdgShellClientRules::testKeepBelowForce() { // Initialize RuleBook with the test rule. @@ -3657,11 +3399,10 @@ void TestXdgShellClientRules::testKeepBelowForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept below. @@ -3675,7 +3416,7 @@ void TestXdgShellClientRules::testKeepBelowForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->keepBelow()); @@ -3685,16 +3426,13 @@ void TestXdgShellClientRules::testKeepBelowForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepBelowApplyNow) - void TestXdgShellClientRules::testKeepBelowApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->keepBelow()); @@ -3728,8 +3466,6 @@ void TestXdgShellClientRules::testKeepBelowApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testKeepBelowForceTemporarily) - void TestXdgShellClientRules::testKeepBelowForceTemporarily() { // Initialize RuleBook with the test rule. @@ -3746,11 +3482,10 @@ void TestXdgShellClientRules::testKeepBelowForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // Initially, the client should be kept below. @@ -3764,7 +3499,7 @@ void TestXdgShellClientRules::testKeepBelowForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(!client->keepBelow()); @@ -3780,8 +3515,6 @@ void TestXdgShellClientRules::testKeepBelowForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testShortcutDontAffect) - void TestXdgShellClientRules::testShortcutDontAffect() { // Initialize RuleBook with the test rule. @@ -3798,11 +3531,10 @@ void TestXdgShellClientRules::testShortcutDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QCOMPARE(client->shortcut(), QKeySequence()); client->minimize(); @@ -3827,8 +3559,6 @@ void TestXdgShellClientRules::testShortcutDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testShortcutApply) - void TestXdgShellClientRules::testShortcutApply() { // Initialize RuleBook with the test rule. @@ -3845,11 +3575,10 @@ void TestXdgShellClientRules::testShortcutApply() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // If we press the window shortcut, the window should be brought back to user. @@ -3898,7 +3627,7 @@ void TestXdgShellClientRules::testShortcutApply() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The window shortcut should be set back to Ctrl+Alt+1. @@ -3910,8 +3639,6 @@ void TestXdgShellClientRules::testShortcutApply() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testShortcutRemember) - void TestXdgShellClientRules::testShortcutRemember() { QSKIP("KWin core doesn't try to save the last used window shortcut"); @@ -3930,11 +3657,10 @@ void TestXdgShellClientRules::testShortcutRemember() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // If we press the window shortcut, the window should be brought back to user. @@ -3971,7 +3697,7 @@ void TestXdgShellClientRules::testShortcutRemember() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The window shortcut should be set to the last known value. @@ -3983,8 +3709,6 @@ void TestXdgShellClientRules::testShortcutRemember() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testShortcutForce) - void TestXdgShellClientRules::testShortcutForce() { QSKIP("KWin core can't release forced window shortcuts"); @@ -4003,11 +3727,10 @@ void TestXdgShellClientRules::testShortcutForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // If we press the window shortcut, the window should be brought back to user. @@ -4044,7 +3767,7 @@ void TestXdgShellClientRules::testShortcutForce() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // The window shortcut should still be forced. @@ -4056,16 +3779,13 @@ void TestXdgShellClientRules::testShortcutForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testShortcutApplyNow) - void TestXdgShellClientRules::testShortcutApplyNow() { // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->shortcut().isEmpty()); @@ -4122,8 +3842,6 @@ void TestXdgShellClientRules::testShortcutApplyNow() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testShortcutForceTemporarily) - void TestXdgShellClientRules::testShortcutForceTemporarily() { QSKIP("KWin core can't release forced window shortcuts"); @@ -4142,11 +3860,10 @@ void TestXdgShellClientRules::testShortcutForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); // If we press the window shortcut, the window should be brought back to user. @@ -4183,7 +3900,7 @@ void TestXdgShellClientRules::testShortcutForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->shortcut().isEmpty()); @@ -4193,8 +3910,6 @@ void TestXdgShellClientRules::testShortcutForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testDesktopFileDontAffect) - void TestXdgShellClientRules::testDesktopFileDontAffect() { // Currently, the desktop file name is derived from the app id. If the app id is @@ -4203,8 +3918,6 @@ void TestXdgShellClientRules::testDesktopFileDontAffect() QSKIP("Needs changes in KWin core to pass"); } -TEST_DATA(testDesktopFileApply) - void TestXdgShellClientRules::testDesktopFileApply() { // Currently, the desktop file name is derived from the app id. If the app id is @@ -4213,8 +3926,6 @@ void TestXdgShellClientRules::testDesktopFileApply() QSKIP("Needs changes in KWin core to pass"); } -TEST_DATA(testDesktopFileRemember) - void TestXdgShellClientRules::testDesktopFileRemember() { // Currently, the desktop file name is derived from the app id. If the app id is @@ -4223,8 +3934,6 @@ void TestXdgShellClientRules::testDesktopFileRemember() QSKIP("Needs changes in KWin core to pass"); } -TEST_DATA(testDesktopFileForce) - void TestXdgShellClientRules::testDesktopFileForce() { // Currently, the desktop file name is derived from the app id. If the app id is @@ -4233,8 +3942,6 @@ void TestXdgShellClientRules::testDesktopFileForce() QSKIP("Needs changes in KWin core to pass"); } -TEST_DATA(testDesktopFileApplyNow) - void TestXdgShellClientRules::testDesktopFileApplyNow() { // Currently, the desktop file name is derived from the app id. If the app id is @@ -4243,8 +3950,6 @@ void TestXdgShellClientRules::testDesktopFileApplyNow() QSKIP("Needs changes in KWin core to pass"); } -TEST_DATA(testDesktopFileForceTemporarily) - void TestXdgShellClientRules::testDesktopFileForceTemporarily() { // Currently, the desktop file name is derived from the app id. If the app id is @@ -4253,8 +3958,6 @@ void TestXdgShellClientRules::testDesktopFileForceTemporarily() QSKIP("Needs changes in KWin core to pass"); } -TEST_DATA(testActiveOpacityDontAffect) - void TestXdgShellClientRules::testActiveOpacityDontAffect() { // Initialize RuleBook with the test rule. @@ -4271,11 +3974,10 @@ void TestXdgShellClientRules::testActiveOpacityDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -4288,8 +3990,6 @@ void TestXdgShellClientRules::testActiveOpacityDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testActiveOpacityForce) - void TestXdgShellClientRules::testActiveOpacityForce() { // Initialize RuleBook with the test rule. @@ -4306,11 +4006,10 @@ void TestXdgShellClientRules::testActiveOpacityForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->opacity(), 0.9); @@ -4321,8 +4020,6 @@ void TestXdgShellClientRules::testActiveOpacityForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testActiveOpacityForceTemporarily) - void TestXdgShellClientRules::testActiveOpacityForceTemporarily() { // Initialize RuleBook with the test rule. @@ -4339,11 +4036,10 @@ void TestXdgShellClientRules::testActiveOpacityForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->opacity(), 0.9); @@ -4352,7 +4048,7 @@ void TestXdgShellClientRules::testActiveOpacityForceTemporarily() delete shellSurface; delete surface; QVERIFY(Test::waitForWindowDestroyed(client)); - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->opacity(), 1.0); @@ -4363,8 +4059,6 @@ void TestXdgShellClientRules::testActiveOpacityForceTemporarily() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testInactiveOpacityDontAffect) - void TestXdgShellClientRules::testInactiveOpacityDontAffect() { // Initialize RuleBook with the test rule. @@ -4381,11 +4075,10 @@ void TestXdgShellClientRules::testInactiveOpacityDontAffect() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); @@ -4402,8 +4095,6 @@ void TestXdgShellClientRules::testInactiveOpacityDontAffect() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testInactiveOpacityForce) - void TestXdgShellClientRules::testInactiveOpacityForce() { // Initialize RuleBook with the test rule. @@ -4420,11 +4111,10 @@ void TestXdgShellClientRules::testInactiveOpacityForce() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->opacity(), 1.0); @@ -4442,8 +4132,6 @@ void TestXdgShellClientRules::testInactiveOpacityForce() QVERIFY(Test::waitForWindowDestroyed(client)); } -TEST_DATA(testInactiveOpacityForceTemporarily) - void TestXdgShellClientRules::testInactiveOpacityForceTemporarily() { // Initialize RuleBook with the test rule. @@ -4460,11 +4148,10 @@ void TestXdgShellClientRules::testInactiveOpacityForceTemporarily() workspace()->slotReconfigure(); // Create the test client. - QFETCH(Test::XdgShellSurfaceType, type); AbstractClient *client; Surface *surface; XdgShellSurface *shellSurface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->opacity(), 1.0); @@ -4479,7 +4166,7 @@ void TestXdgShellClientRules::testInactiveOpacityForceTemporarily() // The rule should be discarded when the client is closed. delete shellSurface; delete surface; - std::tie(client, surface, shellSurface) = createWindow(type, "org.kde.foo"); + std::tie(client, surface, shellSurface) = createWindow("org.kde.foo"); QVERIFY(client); QVERIFY(client->isActive()); QCOMPARE(client->opacity(), 1.0); diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp index aa8ee11489..c0833b1f71 100644 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -62,39 +62,28 @@ private Q_SLOTS: void testMapUnmap(); void testDesktopPresenceChanged(); - void testWindowOutputs_data(); void testWindowOutputs(); - void testMinimizeActiveWindow_data(); void testMinimizeActiveWindow(); void testFullscreen_data(); void testFullscreen(); - void testFullscreenRestore_data(); void testFullscreenRestore(); - void testUserCanSetFullscreen_data(); void testUserCanSetFullscreen(); - void testUserSetFullscreen_data(); void testUserSetFullscreen(); void testMaximizedToFullscreen_data(); void testMaximizedToFullscreen(); - void testWindowOpensLargerThanScreen_data(); void testWindowOpensLargerThanScreen(); - void testHidden_data(); void testHidden(); void testDesktopFileName(); void testCaptionSimplified(); void testCaptionMultipleWindows(); void testUnresponsiveWindow_data(); void testUnresponsiveWindow(); - void testX11WindowId_data(); void testX11WindowId(); void testAppMenu(); - void testNoDecorationModeRequested_data(); void testNoDecorationModeRequested(); - void testSendClientWithTransientToDesktop_data(); void testSendClientWithTransientToDesktop(); - void testMinimizeWindowWithTransients_data(); void testMinimizeWindowWithTransients(); void testXdgDecoration_data(); void testXdgDecoration(); @@ -247,18 +236,10 @@ void TestXdgShellClient::testDesktopPresenceChanged() QCOMPARE(desktopPresenceChangedEffectsSpy.first().at(2).toInt(), 2); } -void TestXdgShellClient::testWindowOutputs_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testWindowOutputs() { QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto size = QSize(200,200); QSignalSpy outputEnteredSpy(surface.data(), &Surface::outputEntered); @@ -292,19 +273,11 @@ void TestXdgShellClient::testWindowOutputs() QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(1280,0)); } -void TestXdgShellClient::testMinimizeActiveWindow_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testMinimizeActiveWindow() { // this test verifies that when minimizing the active window it gets deactivated QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QVERIFY(c->isActive()); @@ -333,12 +306,10 @@ void TestXdgShellClient::testMinimizeActiveWindow() void TestXdgShellClient::testFullscreen_data() { - QTest::addColumn("type"); QTest::addColumn("decoMode"); - QTest::newRow("xdgShellWmBase") << Test::XdgShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Client; - - QTest::newRow("xdgShellWmBase - deco") << Test::XdgShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Server; + QTest::newRow("client-side deco") << ServerSideDecoration::Mode::Client; + QTest::newRow("server-side deco") << ServerSideDecoration::Mode::Server; } void TestXdgShellClient::testFullscreen() @@ -348,8 +319,7 @@ void TestXdgShellClient::testFullscreen() XdgShellSurface::States states; QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(shellSurface); // create deco @@ -435,19 +405,11 @@ void TestXdgShellClient::testFullscreen() QVERIFY(Test::waitForWindowDestroyed(client)); } -void TestXdgShellClient::testFullscreenRestore_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgShellWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testFullscreenRestore() { // this test verifies that windows created fullscreen can be later properly restored QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - XdgShellSurface *xdgShellSurface = Test::createXdgShellSurface(type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly); + XdgShellSurface *xdgShellSurface = Test::createXdgShellStableSurface(surface.data(), surface.data(), Test::CreationSetup::CreateOnly); QSignalSpy configureRequestedSpy(xdgShellSurface, &XdgShellSurface::configureRequested); // fullscreen the window @@ -495,18 +457,10 @@ void TestXdgShellClient::testFullscreenRestore() QCOMPARE(c->frameGeometry().size(), QSize(100, 50)); } -void TestXdgShellClient::testUserCanSetFullscreen_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testUserCanSetFullscreen() { QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QVERIFY(c->isActive()); @@ -514,19 +468,11 @@ void TestXdgShellClient::testUserCanSetFullscreen() QVERIFY(c->userCanSetFullScreen()); } -void TestXdgShellClient::testUserSetFullscreen_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testUserSetFullscreen() { QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface( - type, surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); + QScopedPointer shellSurface(Test::createXdgShellStableSurface( + surface.data(), surface.data(), Test::CreationSetup::CreateOnly)); QVERIFY(!shellSurface.isNull()); // wait for the initial configure event @@ -577,12 +523,10 @@ void TestXdgShellClient::testUserSetFullscreen() void TestXdgShellClient::testMaximizedToFullscreen_data() { - QTest::addColumn("type"); QTest::addColumn("decoMode"); - QTest::newRow("xdgShellWmBase") << Test::XdgShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Client; - - QTest::newRow("xdgShellWmBase - deco") << Test::XdgShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Server; + QTest::newRow("client-side deco") << ServerSideDecoration::Mode::Client; + QTest::newRow("server-side deco") << ServerSideDecoration::Mode::Server; } void TestXdgShellClient::testMaximizedToFullscreen() @@ -592,8 +536,7 @@ void TestXdgShellClient::testMaximizedToFullscreen() XdgShellSurface::States states; QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QVERIFY(shellSurface); // create deco @@ -683,20 +626,12 @@ void TestXdgShellClient::testMaximizedToFullscreen() QVERIFY(Test::waitForWindowDestroyed(client)); } -void TestXdgShellClient::testWindowOpensLargerThanScreen_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testWindowOpensLargerThanScreen() { // this test creates a window which is as large as the screen, but is decorated // the window should get resized to fit into the screen, BUG: 366632 QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QSignalSpy sizeChangeRequestedSpy(shellSurface.data(), SIGNAL(sizeChanged(QSize))); QVERIFY(sizeChangeRequestedSpy.isValid()); @@ -717,19 +652,11 @@ void TestXdgShellClient::testWindowOpensLargerThanScreen() QCOMPARE(c->frameGeometry(), QRect(QPoint(0, 0), screens()->size(0))); } -void TestXdgShellClient::testHidden_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testHidden() { // this test verifies that when hiding window it doesn't get shown QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QVERIFY(c->isActive()); @@ -936,18 +863,10 @@ void TestXdgShellClient::testUnresponsiveWindow() QVERIFY(elapsed2 > 1800); //second ping comes in a second later } -void TestXdgShellClient::testX11WindowId_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testX11WindowId() { QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QVERIFY(c->windowId() != 0); @@ -974,19 +893,11 @@ void TestXdgShellClient::testAppMenu() QVERIFY (QDBusConnection::sessionBus().unregisterService("org.kde.kappmenu")); } -void TestXdgShellClient::testNoDecorationModeRequested_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testNoDecorationModeRequested() { // this test verifies that the decoration follows the default mode if no mode is explicitly requested QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); QScopedPointer deco(Test::waylandServerSideDecoration()->create(surface.data())); QSignalSpy decoSpy(deco.data(), &ServerSideDecoration::modeChanged); QVERIFY(decoSpy.isValid()); @@ -1001,28 +912,20 @@ void TestXdgShellClient::testNoDecorationModeRequested() QCOMPARE(c->isDecorated(), true); } -void TestXdgShellClient::testSendClientWithTransientToDesktop_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testSendClientWithTransientToDesktop() { // this test verifies that when sending a client to a desktop all transients are also send to that desktop VirtualDesktopManager::self()->setCount(2); QScopedPointer surface{Test::createSurface()}; - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); // let's create a transient window QScopedPointer transientSurface{Test::createSurface()}; - QScopedPointer transientShellSurface(Test::createXdgShellSurface(type, transientSurface.data())); + QScopedPointer transientShellSurface(Test::createXdgShellStableSurface(transientSurface.data())); transientShellSurface->setTransientFor(shellSurface.data()); auto transient = Test::renderAndWaitForShown(transientSurface.data(), QSize(100, 50), Qt::blue); @@ -1055,13 +958,6 @@ void TestXdgShellClient::testSendClientWithTransientToDesktop() QCOMPARE(transient->desktop(), 1); } -void TestXdgShellClient::testMinimizeWindowWithTransients_data() -{ - QTest::addColumn("type"); - - QTest::newRow("xdgWmBase") << Test::XdgShellSurfaceType::XdgShellStable; -} - void TestXdgShellClient::testMinimizeWindowWithTransients() { // this test verifies that when minimizing/unminimizing a window all its @@ -1069,15 +965,14 @@ void TestXdgShellClient::testMinimizeWindowWithTransients() // create the main window QScopedPointer surface(Test::createSurface()); - QFETCH(Test::XdgShellSurfaceType, type); - QScopedPointer shellSurface(Test::createXdgShellSurface(type, surface.data())); + QScopedPointer shellSurface(Test::createXdgShellStableSurface(surface.data())); auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue); QVERIFY(c); QVERIFY(!c->isMinimized()); // create a transient window QScopedPointer transientSurface(Test::createSurface()); - QScopedPointer transientShellSurface(Test::createXdgShellSurface(type, transientSurface.data())); + QScopedPointer transientShellSurface(Test::createXdgShellStableSurface(transientSurface.data())); transientShellSurface->setTransientFor(shellSurface.data()); auto transient = Test::renderAndWaitForShown(transientSurface.data(), QSize(100, 50), Qt::red); QVERIFY(transient);