Commit 6d3f00e8 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

autotests: Remove QVERIFY(signalSpy.isValid())

We use the PMF syntax so the isValid() check is unnecessary as the
compiler will notify about wrong signal at compile time. It makes
writing autotests feel less boilerplaty.
parent 98b8a5d4
Pipeline #231724 passed with stage
in 15 minutes and 45 seconds
......@@ -49,7 +49,6 @@ void ActivationTest::initTestCase()
qRegisterMetaType<Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -371,7 +370,6 @@ void ActivationTest::testSwitchToWindowMaximized()
workspace()->slotWindowMaximize();
QVERIFY(surfaceConfigureRequestedSpy1.wait());
QSignalSpy frameGeometryChangedSpy1(window1, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy1.isValid());
shellSurface1->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy1.last().at(0).value<quint32>());
Test::render(surface1.get(), toplevelConfigureRequestedSpy1.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy1.wait());
......@@ -387,7 +385,6 @@ void ActivationTest::testSwitchToWindowMaximized()
workspace()->slotWindowMaximize();
QVERIFY(surfaceConfigureRequestedSpy2.wait());
QSignalSpy frameGeometryChangedSpy2(window2, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy2.isValid());
shellSurface2->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy2.last().at(0).value<quint32>());
Test::render(surface2.get(), toplevelConfigureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy2.wait());
......@@ -458,7 +455,6 @@ void ActivationTest::testSwitchToWindowFullScreen()
workspace()->slotWindowFullScreen();
QVERIFY(surfaceConfigureRequestedSpy1.wait());
QSignalSpy frameGeometryChangedSpy1(window1, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy1.isValid());
shellSurface1->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy1.last().at(0).value<quint32>());
Test::render(surface1.get(), toplevelConfigureRequestedSpy1.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy1.wait());
......@@ -474,7 +470,6 @@ void ActivationTest::testSwitchToWindowFullScreen()
workspace()->slotWindowFullScreen();
QVERIFY(surfaceConfigureRequestedSpy2.wait());
QSignalSpy frameGeometryChangedSpy2(window2, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy2.isValid());
shellSurface2->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy2.last().at(0).value<quint32>());
Test::render(surface2.get(), toplevelConfigureRequestedSpy2.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy2.wait());
......
......@@ -49,7 +49,6 @@ void ActivitiesTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Deleted *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -119,7 +118,6 @@ void ActivitiesTest::testSetOnActivitiesValidates()
// we should get a window for it
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
......@@ -141,7 +139,6 @@ void ActivitiesTest::testSetOnActivitiesValidates()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
......
......@@ -58,7 +58,6 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
// add a first repaint
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
Compositor::self()->scene()->addRepaintFull();
QVERIFY(frameRenderedSpy.wait());
......@@ -66,7 +65,6 @@ void BufferSizeChangeTest::testShmBufferSizeChange()
Test::render(surface.get(), QSize(30, 10), Qt::red);
QSignalSpy damagedSpy(window, &Window::damaged);
QVERIFY(damagedSpy.isValid());
QVERIFY(damagedSpy.wait());
KWin::Compositor::self()->scene()->addRepaintFull();
QVERIFY(frameRenderedSpy.wait());
......@@ -95,13 +93,11 @@ void BufferSizeChangeTest::testShmBufferSizeChangeOnSubSurface()
// add a first repaint
QSignalSpy frameRenderedSpy(Compositor::self()->scene(), &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
Compositor::self()->scene()->addRepaintFull();
QVERIFY(frameRenderedSpy.wait());
// change buffer size of sub surface
QSignalSpy damagedParentSpy(parent, &Window::damaged);
QVERIFY(damagedParentSpy.isValid());
Test::render(surface.get(), QSize(20, 10), Qt::red);
parentSurface->commit(KWayland::Client::Surface::CommitFlag::None);
......
......@@ -59,7 +59,6 @@ void TestDbusInterface::initTestCase()
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
......@@ -101,7 +100,6 @@ void TestDbusInterface::testGetWindowInfoInvalidUuid()
void TestDbusInterface::testGetWindowInfoXdgShellClient()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
......@@ -209,7 +207,6 @@ void TestDbusInterface::testGetWindowInfoXdgShellClient()
// finally close window
const auto id = window->internalId();
QSignalSpy windowClosedSpy(window, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
shellSurface.reset();
surface.reset();
QVERIFY(windowClosedSpy.wait());
......@@ -254,7 +251,6 @@ void TestDbusInterface::testGetWindowInfoX11Client()
// we should get a window for it
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
......@@ -376,7 +372,6 @@ void TestDbusInterface::testGetWindowInfoX11Client()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
xcb_destroy_window(c.get(), windowId);
c.reset();
......
......@@ -50,7 +50,6 @@ void DebugConsoleTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::InternalWindow *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -124,7 +123,6 @@ void DebugConsoleTest::testX11Window()
// start glxgears, to get a window, which should be added to the model
QSignalSpy rowsInsertedSpy(&model, &QAbstractItemModel::rowsInserted);
QVERIFY(rowsInsertedSpy.isValid());
QProcess glxgears;
glxgears.setProgram(QStringLiteral("glxgears"));
......@@ -180,7 +178,6 @@ void DebugConsoleTest::testX11Window()
// now close the window again, it should be removed from the model
QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved);
QVERIFY(rowsRemovedSpy.isValid());
glxgears.terminate();
QVERIFY(glxgears.waitForFinished());
......@@ -212,7 +209,6 @@ void DebugConsoleTest::testX11Unmanaged()
// we need to create an unmanaged window
QSignalSpy rowsInsertedSpy(&model, &QAbstractItemModel::rowsInserted);
QVERIFY(rowsInsertedSpy.isValid());
// let's create an override redirect window
const uint32_t values[] = {true};
......@@ -270,7 +266,6 @@ void DebugConsoleTest::testX11Unmanaged()
// now close the window again, it should be removed from the model
QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved);
QVERIFY(rowsRemovedSpy.isValid());
window.unmap();
......@@ -302,7 +297,6 @@ void DebugConsoleTest::testWaylandClient()
// we need to create a wayland window
QSignalSpy rowsInsertedSpy(&model, &QAbstractItemModel::rowsInserted);
QVERIFY(rowsInsertedSpy.isValid());
// create our connection
QVERIFY(Test::setupWaylandConnection());
......@@ -366,7 +360,6 @@ void DebugConsoleTest::testWaylandClient()
// now close the window again, it should be removed from the model
QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved);
QVERIFY(rowsRemovedSpy.isValid());
surface->attachBuffer(Buffer::Ptr());
surface->commit(KWayland::Client::Surface::CommitFlag::None);
......@@ -421,7 +414,6 @@ void DebugConsoleTest::testInternalWindow()
// given that we just test whether adding a window works.
QSignalSpy rowsInsertedSpy(&model, &QAbstractItemModel::rowsInserted);
QVERIFY(rowsInsertedSpy.isValid());
std::unique_ptr<HelperWindow> w(new HelperWindow);
w->setGeometry(0, 0, 100, 100);
......@@ -470,7 +462,6 @@ void DebugConsoleTest::testInternalWindow()
// now close the window again, it should be removed from the model
QSignalSpy rowsRemovedSpy(&model, &QAbstractItemModel::rowsRemoved);
QVERIFY(rowsRemovedSpy.isValid());
w->hide();
w.reset();
......@@ -486,10 +477,8 @@ void DebugConsoleTest::testClosingDebugConsole()
DebugConsole *console = new DebugConsole;
QSignalSpy destroyedSpy(console, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
console->show();
QCOMPARE(console->windowHandle()->isVisible(), true);
QTRY_COMPARE(windowAddedSpy.count(), 1);
......
......@@ -122,7 +122,6 @@ void DecorationInputTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::InternalWindow *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -378,9 +377,7 @@ void DecorationInputTest::testPressToMove()
QVERIFY(!window->noBorder());
window->move(workspace()->activeOutput()->geometry().center() - QPoint(window->width() / 2, window->height() / 2));
QSignalSpy startMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
quint32 timestamp = 1;
MOTION(QPoint(window->frameGeometry().center().x(), window->y() + window->clientPos().y() / 2));
......@@ -437,9 +434,7 @@ void DecorationInputTest::testTapToMove()
QVERIFY(!window->noBorder());
window->move(workspace()->activeOutput()->geometry().center() - QPoint(window->width() / 2, window->height() / 2));
QSignalSpy startMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
quint32 timestamp = 1;
QPoint p = QPoint(window->frameGeometry().center().x(), window->y() + window->clientPos().y() / 2);
......@@ -505,7 +500,6 @@ void DecorationInputTest::testResizeOutsideWindow()
QVERIFY(window->frameGeometry() != window->inputGeometry());
QVERIFY(window->inputGeometry().contains(window->frameGeometry()));
QSignalSpy startMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
// go to border
quint32 timestamp = 1;
......@@ -723,9 +717,7 @@ void DecorationInputTest::testTouchEvents()
EventHelper helper;
window->decoration()->installEventFilter(&helper);
QSignalSpy hoverMoveSpy(&helper, &EventHelper::hoverMove);
QVERIFY(hoverMoveSpy.isValid());
QSignalSpy hoverLeaveSpy(&helper, &EventHelper::hoverLeave);
QVERIFY(hoverLeaveSpy.isValid());
quint32 timestamp = 1;
const QPoint tapPoint(window->frameGeometry().center().x(), window->clientPos().y() / 2);
......@@ -762,7 +754,6 @@ void DecorationInputTest::testTooltipDoesntEatKeyEvents()
auto keyboard = Test::waylandSeat()->createKeyboard(Test::waylandSeat());
QVERIFY(keyboard);
QSignalSpy enteredSpy(keyboard, &KWayland::Client::Keyboard::entered);
QVERIFY(enteredSpy.isValid());
const auto [window, surface] = showWindow();
QVERIFY(window);
......@@ -774,7 +765,6 @@ void DecorationInputTest::testTooltipDoesntEatKeyEvents()
QVERIFY(keyEvent.isValid());
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
window->decoratedClient()->requestShowToolTip(QStringLiteral("test"));
// now we should get an internal window
QVERIFY(windowAddedSpy.wait());
......
......@@ -44,7 +44,6 @@ void X11DesktopWindowTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Deleted *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -137,7 +136,6 @@ void X11DesktopWindowTest::testDesktopWindow()
// we should get a window for it
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
......@@ -156,7 +154,6 @@ void X11DesktopWindowTest::testDesktopWindow()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
......
......@@ -43,7 +43,6 @@ void DontCrashAuroraeDestroyDecoTest::initTestCase()
qputenv("XDG_DATA_DIRS", QCoreApplication::applicationDirPath().toUtf8());
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -96,7 +95,6 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows()
// we should get a window for it
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
......@@ -117,7 +115,6 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows()
// simulate click on maximize button
QSignalSpy maximizedStateChangedSpy(window, static_cast<void (Window::*)(KWin::Window *, MaximizeMode)>(&Window::clientMaximizedStateChanged));
QVERIFY(maximizedStateChangedSpy.isValid());
quint32 timestamp = 1;
Test::pointerMotion(window->frameGeometry().topLeft() + scenePoint.toPoint(), timestamp++);
Test::pointerButtonPressed(BTN_LEFT, timestamp++);
......@@ -133,7 +130,6 @@ void DontCrashAuroraeDestroyDecoTest::testBorderlessMaximizedWindows()
xcb_disconnect(c);
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
......
......@@ -50,7 +50,6 @@ void DontCrashCancelAnimationFromAnimationEndedTest::initTestCase()
kwinApp()->start();
QVERIFY(Compositor::self());
QSignalSpy compositorToggledSpy(Compositor::self(), &Compositor::compositingToggled);
QVERIFY(compositorToggledSpy.isValid());
QVERIFY(compositorToggledSpy.wait());
QVERIFY(effects);
}
......@@ -97,7 +96,6 @@ void DontCrashCancelAnimationFromAnimationEndedTest::testScript()
// wait for the window to be passed to Deleted
QSignalSpy windowDeletedSpy(window, &Window::windowClosed);
QVERIFY(windowDeletedSpy.isValid());
surface.reset();
......
......@@ -56,7 +56,6 @@ void DontCrashCursorPhysicalSizeEmpty::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......
......@@ -40,7 +40,6 @@ void DontCrashEmptyDecorationTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -81,7 +80,6 @@ void DontCrashEmptyDecorationTest::testBug361551()
// we should get a window for it
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
......@@ -99,7 +97,6 @@ void DontCrashEmptyDecorationTest::testBug361551()
xcb_disconnect(c);
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
......
......@@ -34,7 +34,6 @@ void DontCrashGlxgearsTest::initTestCase()
{
qRegisterMetaType<KWin::Deleted *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
kwinApp()->start();
......@@ -47,7 +46,6 @@ void DontCrashGlxgearsTest::testGlxgears()
// Let's make sure that doesn't happen anymore
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
QProcess glxgears;
glxgears.setProgram(QStringLiteral("glxgears"));
......@@ -60,7 +58,6 @@ void DontCrashGlxgearsTest::testGlxgears()
X11Window *glxgearsWindow = workspace()->clientList().first();
QVERIFY(glxgearsWindow->isDecorated());
QSignalSpy closedSpy(glxgearsWindow, &X11Window::windowClosed);
QVERIFY(closedSpy.isValid());
KDecoration2::Decoration *decoration = glxgearsWindow->decoration();
QVERIFY(decoration);
......
......@@ -44,7 +44,6 @@ void DontCrashNoBorder::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......
......@@ -47,7 +47,6 @@ void DontCrashReinitializeCompositorTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Deleted *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......@@ -130,7 +129,6 @@ void DontCrashReinitializeCompositorTest::testReinitializeCompositor()
// Close the test window.
QSignalSpy windowClosedSpy(window, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
shellSurface.reset();
surface.reset();
QVERIFY(windowClosedSpy.wait());
......
......@@ -48,7 +48,6 @@ void TestDontCrashUseractionsMenu::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
......
......@@ -44,7 +44,6 @@ void DesktopSwitchingAnimationTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
......
......@@ -42,7 +42,6 @@ void MaximizeAnimationTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
......@@ -131,9 +130,7 @@ void MaximizeAnimationTest::testMaximizeRestore()
// Maximize the window.
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy maximizeChangedSpy(window, qOverload<Window *, bool, bool>(&Window::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy.isValid());
workspace()->slotWindowMaximize();
QVERIFY(surfaceConfigureRequestedSpy.wait());
......
......@@ -45,7 +45,6 @@ void MinimizeAnimationTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
......@@ -99,7 +98,6 @@ void MinimizeAnimationTest::testMinimizeUnminimize()
using namespace KWayland::Client;
QSignalSpy plasmaWindowCreatedSpy(Test::waylandWindowManagement(), &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
// Create a panel at the top of the screen.
const QRect panelRect = QRect(0, 0, 1280, 36);
......
......@@ -51,7 +51,6 @@ void PopupOpenCloseAnimationTest::initTestCase()
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::InternalWindow *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
......@@ -133,7 +132,6 @@ void PopupOpenCloseAnimationTest::testAnimatePopups()
// Destroy the popup, it should not be animated.
QSignalSpy popupClosedSpy(popup, &Window::windowClosed);
QVERIFY(popupClosedSpy.isValid());
popupShellSurface.reset();
popupSurface.reset();
QVERIFY(popupClosedSpy.wait());
......@@ -238,7 +236,6 @@ void PopupOpenCloseAnimationTest::testAnimateDecorationTooltips()
// Show a decoration tooltip.
QSignalSpy tooltipAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(tooltipAddedSpy.isValid());
window->decoratedClient()->requestShowToolTip(QStringLiteral("KWin rocks!"));
QVERIFY(tooltipAddedSpy.wait());
InternalWindow *tooltip = tooltipAddedSpy.first().first().value<InternalWindow *>();
......@@ -252,7 +249,6 @@ void PopupOpenCloseAnimationTest::testAnimateDecorationTooltips()
// Hide the decoration tooltip.
QSignalSpy tooltipClosedSpy(tooltip, &InternalWindow::windowClosed);
QVERIFY(tooltipClosedSpy.isValid());
window->decoratedClient()->requestHideToolTip();
QVERIFY(tooltipClosedSpy.wait());
QVERIFY(effect->isActive());
......
......@@ -130,7 +130,6 @@ void ScriptedEffectsTest::initTestCase()
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::Effect *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
......@@ -433,7 +432,6 @@ void ScriptedEffectsTest::testKeepAlive()
auto *effect = new ScriptedEffectWithDebugSpy;
QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(effectOutputSpy.isValid());
QVERIFY(effect->load(file));
// create a window
......@@ -465,7 +463,6 @@ void ScriptedEffectsTest::testKeepAlive()
// the test effect doesn't keep the window alive, so it should be
// removed immediately
QSignalSpy deletedRemovedSpy(workspace(), &Workspace::deletedRemoved);
QVERIFY(deletedRemovedSpy.isValid());
QVERIFY(deletedRemovedSpy.count() == 1 || deletedRemovedSpy.wait(100)); // 100ms is less than duration of the animation
QCOMPARE(effect->state().count(), 0);
}
......@@ -479,7 +476,6 @@ void ScriptedEffectsTest::testGrab()
// load the test effect
auto effect = new ScriptedEffectWithDebugSpy;
QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(effectOutputSpy.isValid());
QVERIFY(effect->load(QStringLiteral("grabTest")));
// create test window
......@@ -506,13 +502,11 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindow()
// load effect that will hold the window grab
auto owner = new ScriptedEffectWithDebugSpy;
QSignalSpy ownerOutputSpy(owner, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(ownerOutputSpy.isValid());
QVERIFY(owner->load(QStringLiteral("grabAlreadyGrabbedWindowTest_owner")));
// load effect that will try to grab already grabbed window
auto grabber = new ScriptedEffectWithDebugSpy;
QSignalSpy grabberOutputSpy(grabber, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(grabberOutputSpy.isValid());
QVERIFY(grabber->load(QStringLiteral("grabAlreadyGrabbedWindowTest_grabber")));
// create test window
......@@ -543,13 +537,11 @@ void ScriptedEffectsTest::testGrabAlreadyGrabbedWindowForced()
// load effect that initially will be holding the window grab
auto owner = new ScriptedEffectWithDebugSpy;
QSignalSpy ownerOutputSpy(owner, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(ownerOutputSpy.isValid());
QVERIFY(owner->load(QStringLiteral("grabAlreadyGrabbedWindowForcedTest_owner")));
// load effect that will try to steal the window grab
auto thief = new ScriptedEffectWithDebugSpy;
QSignalSpy thiefOutputSpy(thief, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(thiefOutputSpy.isValid());
QVERIFY(thief->load(QStringLiteral("grabAlreadyGrabbedWindowForcedTest_thief")));
// create test window
......@@ -580,7 +572,6 @@ void ScriptedEffectsTest::testUngrab()
// load the test effect
auto effect = new ScriptedEffectWithDebugSpy;
QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(effectOutputSpy.isValid());
QVERIFY(effect->load(QStringLiteral("ungrabTest")));
// create test window
......@@ -659,7 +650,6 @@ void ScriptedEffectsTest::testRedirect()
QTest::qWait(250);
QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(effectOutputSpy.isValid());
window->setMinimized(true);
......@@ -747,7 +737,6 @@ void ScriptedEffectsTest::testComplete()
// minimize the test window, when the test effect sees that a window was
// minimized, it will try to complete animation for it
QSignalSpy effectOutputSpy(effect, &ScriptedEffectWithDebugSpy::testOutput);
QVERIFY(effectOutputSpy.isValid());