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.
This commit is contained in:
Vlad Zahorodnii 2022-09-14 11:30:13 +03:00
parent 98b8a5d4ba
commit 6d3f00e82c
112 changed files with 0 additions and 1273 deletions

View file

@ -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());

View file

@ -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());
}

View file

@ -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);

View file

@ -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();

View file

@ -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);

View file

@ -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());

View file

@ -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());
}

View file

@ -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());
}

View file

@ -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();

View file

@ -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));

View file

@ -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());
}

View file

@ -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);

View file

@ -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));

View file

@ -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());

View file

@ -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));

View file

@ -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));

View file

@ -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());

View file

@ -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);

View file

@ -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());

View file

@ -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());
window->setMinimized(true);

View file

@ -52,7 +52,6 @@ void SlidingPopupsTest::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));
@ -133,7 +132,6 @@ void SlidingPopupsTest::testWithOtherEffect()
auto effectloader = e->findChild<AbstractEffectLoader *>();
QVERIFY(effectloader);
QSignalSpy effectLoadedSpy(effectloader, &AbstractEffectLoader::effectLoaded);
QVERIFY(effectLoadedSpy.isValid());
Effect *slidingPoupus = nullptr;
Effect *otherEffect = nullptr;
@ -162,7 +160,6 @@ void SlidingPopupsTest::testWithOtherEffect()
QTest::qWait(50);
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
QVERIFY(windowAddedSpy.isValid());
// create an xcb window
std::unique_ptr<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
@ -199,7 +196,6 @@ void SlidingPopupsTest::testWithOtherEffect()
// 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);
@ -221,10 +217,8 @@ void SlidingPopupsTest::testWithOtherEffect()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted);
QVERIFY(windowDeletedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
// again we should have the sliding popups active
@ -271,7 +265,6 @@ void SlidingPopupsTest::testWithOtherEffectWayland()
auto effectloader = e->findChild<AbstractEffectLoader *>();
QVERIFY(effectloader);
QSignalSpy effectLoadedSpy(effectloader, &AbstractEffectLoader::effectLoaded);
QVERIFY(effectLoadedSpy.isValid());
Effect *slidingPoupus = nullptr;
Effect *otherEffect = nullptr;
@ -296,7 +289,6 @@ void SlidingPopupsTest::testWithOtherEffectWayland()
QVERIFY(!slidingPoupus->isActive());
QVERIFY(!otherEffect->isActive());
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
QVERIFY(windowAddedSpy.isValid());
using namespace KWayland::Client;
// the test created the slide protocol, let's create a Registry and listen for it
@ -304,7 +296,6 @@ void SlidingPopupsTest::testWithOtherEffectWayland()
registry->create(Test::waylandConnection());
QSignalSpy interfacesAnnouncedSpy(registry.get(), &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
registry->setup();
QVERIFY(interfacesAnnouncedSpy.wait());
auto slideInterface = registry->interface(Registry::Interface::Slide);
@ -340,10 +331,8 @@ void SlidingPopupsTest::testWithOtherEffectWayland()
surface.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted);
QVERIFY(windowDeletedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
// again we should have the sliding popups active

View file

@ -47,7 +47,6 @@ void ToplevelOpenCloseAnimationTest::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));
@ -127,7 +126,6 @@ void ToplevelOpenCloseAnimationTest::testAnimateToplevels()
// Close the test window, the effect should start animating the disappearing
// of the window.
QSignalSpy windowClosedSpy(window, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
shellSurface.reset();
surface.reset();
QVERIFY(windowClosedSpy.wait());
@ -192,7 +190,6 @@ void ToplevelOpenCloseAnimationTest::testDontAnimatePopups()
// Destroy the popup, it should not be animated.
QSignalSpy popupClosedSpy(popup, &Window::windowClosed);
QVERIFY(popupClosedSpy.isValid());
popupShellSurface.reset();
popupSurface.reset();
QVERIFY(popupClosedSpy.wait());

View file

@ -46,7 +46,6 @@ void TranslucencyTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Effect *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -77,7 +76,6 @@ void TranslucencyTest::init()
auto effectloader = e->findChild<AbstractEffectLoader *>();
QVERIFY(effectloader);
QSignalSpy effectLoadedSpy(effectloader, &AbstractEffectLoader::effectLoaded);
QVERIFY(effectLoadedSpy.isValid());
QVERIFY(!e->isEffectLoaded(QStringLiteral("kwin4_effect_translucency")));
QVERIFY(e->loadEffect(QStringLiteral("kwin4_effect_translucency")));
@ -112,7 +110,6 @@ void TranslucencyTest::testMoveAfterDesktopChange()
QVERIFY(!m_translucencyEffect->isActive());
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
QVERIFY(windowAddedSpy.isValid());
// create an xcb window
std::unique_ptr<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
@ -135,7 +132,6 @@ void TranslucencyTest::testMoveAfterDesktopChange()
// 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);
@ -166,7 +162,6 @@ void TranslucencyTest::testMoveAfterDesktopChange()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
xcb_destroy_window(c.get(), windowId);
c.reset();
@ -178,7 +173,6 @@ void TranslucencyTest::testDialogClose()
// with translucency settings for window type dialog the effect never ends when the window gets destroyed
QVERIFY(!m_translucencyEffect->isActive());
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
QVERIFY(windowAddedSpy.isValid());
// create an xcb window
std::unique_ptr<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
@ -203,7 +197,6 @@ void TranslucencyTest::testDialogClose()
// 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);
@ -218,10 +211,8 @@ void TranslucencyTest::testDialogClose()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QSignalSpy windowDeletedSpy(effects, &EffectsHandler::windowDeleted);
QVERIFY(windowDeletedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
if (windowDeletedSpy.isEmpty()) {
QVERIFY(windowDeletedSpy.wait());

View file

@ -47,7 +47,6 @@ void WobblyWindowsShadeTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::Effect *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -120,7 +119,6 @@ void WobblyWindowsShadeTest::testShadeMove()
// 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);
@ -131,7 +129,6 @@ void WobblyWindowsShadeTest::testShadeMove()
QVERIFY(window->isActive());
QSignalSpy windowShownSpy(window, &Window::windowShown);
QVERIFY(windowShownSpy.isValid());
QVERIFY(windowShownSpy.wait());
// now shade the window
@ -139,7 +136,6 @@ void WobblyWindowsShadeTest::testShadeMove()
QVERIFY(window->isShade());
QSignalSpy windowStartUserMovedResizedSpy(e, &EffectsHandler::windowStartUserMovedResized);
QVERIFY(windowStartUserMovedResizedSpy.isValid());
// begin move
QVERIFY(workspace()->moveResizeWindow() == nullptr);

View file

@ -40,7 +40,6 @@ void GenericSceneOpenGLTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -71,7 +70,6 @@ void GenericSceneOpenGLTest::testRestart()
{
// simple restart of the OpenGL compositor without any windows being shown
QSignalSpy sceneCreatedSpy(KWin::Compositor::self(), &Compositor::sceneCreated);
QVERIFY(sceneCreatedSpy.isValid());
KWin::Compositor::self()->reinitialize();
if (sceneCreatedSpy.isEmpty()) {
QVERIFY(sceneCreatedSpy.wait());

View file

@ -58,7 +58,6 @@ void GlobalShortcutsTest::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));
@ -144,7 +143,6 @@ void GlobalShortcutsTest::testNonLatinLayout()
action->setObjectName("globalshortcuts-test-non-latin-layout");
QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
QVERIFY(triggeredSpy.isValid());
KGlobalAccel::self()->stealShortcutSystemwide(seq);
KGlobalAccel::self()->setShortcut(action.get(), {seq}, KGlobalAccel::NoAutoloading);
@ -169,7 +167,6 @@ void GlobalShortcutsTest::testConsumedShift()
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift"));
QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
QVERIFY(triggeredSpy.isValid());
KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::Key_Percent}, KGlobalAccel::NoAutoloading);
input()->registerShortcut(Qt::Key_Percent, action.get());
@ -194,7 +191,6 @@ void GlobalShortcutsTest::testRepeatedTrigger()
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
action->setObjectName(QStringLiteral("globalshortcuts-test-consumed-shift"));
QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
QVERIFY(triggeredSpy.isValid());
KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::Key_Percent}, KGlobalAccel::NoAutoloading);
input()->registerShortcut(Qt::Key_Percent, action.get());
@ -255,7 +251,6 @@ void GlobalShortcutsTest::testMetaShiftW()
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w"));
QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
QVERIFY(triggeredSpy.isValid());
KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::META | Qt::SHIFT | Qt::Key_W}, KGlobalAccel::NoAutoloading);
input()->registerShortcut(Qt::META | Qt::SHIFT | Qt::Key_W, action.get());
@ -281,7 +276,6 @@ void GlobalShortcutsTest::testComponseKey()
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
action->setObjectName(QStringLiteral("globalshortcuts-accent"));
QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
QVERIFY(triggeredSpy.isValid());
KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::NoModifier}, KGlobalAccel::NoAutoloading);
input()->registerShortcut(Qt::NoModifier, action.get());
@ -330,7 +324,6 @@ void GlobalShortcutsTest::testX11WindowShortcut()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -364,7 +357,6 @@ void GlobalShortcutsTest::testX11WindowShortcut()
// destroy window again
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -420,7 +412,6 @@ void GlobalShortcutsTest::testSetupWindowShortcut()
QCOMPARE(window->shortcut(), QKeySequence());
QSignalSpy shortcutDialogAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(shortcutDialogAddedSpy.isValid());
workspace()->slotSetupWindowShortcut();
QTRY_COMPARE(shortcutDialogAddedSpy.count(), 1);
auto dialog = shortcutDialogAddedSpy.first().first().value<InternalWindow *>();

View file

@ -41,7 +41,6 @@ void TestIdleInhibition::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));
@ -196,7 +195,6 @@ void TestIdleInhibition::testDontInhibitWhenUnmapped()
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
QVERIFY(shellSurface != nullptr);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
// Create the inhibitor object.
std::unique_ptr<Test::IdleInhibitorV1> inhibitor(Test::createIdleInhibitorV1(surface.get()));
@ -204,7 +202,6 @@ void TestIdleInhibition::testDontInhibitWhenUnmapped()
// Map the window.
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
Test::render(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(windowAddedSpy.isEmpty());
QVERIFY(windowAddedSpy.wait());

View file

@ -50,7 +50,6 @@ void InputStackingOrderTest::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));
@ -97,13 +96,10 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
// now create the two windows and make them overlap
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface1 = Test::createSurface();
QVERIFY(surface1);
Test::XdgToplevel *shellSurface1 = Test::createXdgToplevelSurface(surface1.get(), surface1.get());
@ -150,7 +146,6 @@ void InputStackingOrderTest::testPointerFocusUpdatesOnStackingOrderChange()
// let's destroy window1, that should pass focus to window2 again
QSignalSpy windowClosedSpy(window1, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
surface1.reset();
QVERIFY(windowClosedSpy.wait());
QVERIFY(enteredSpy.wait());

View file

@ -84,7 +84,6 @@ void InputMethodTest::initTestCase()
qRegisterMetaType<KWayland::Client::Output *>();
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));
@ -118,7 +117,6 @@ void InputMethodTest::testOpenClose()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
QVERIFY(windowAddedSpy.isValid());
// Create an xdg_toplevel surface and wait for the compositor to catch up.
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
@ -128,7 +126,6 @@ void InputMethodTest::testOpenClose()
QVERIFY(window->isActive());
QCOMPARE(window->frameGeometry().size(), QSize(1280, 1024));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
@ -239,7 +236,6 @@ void InputMethodTest::testHidePanel()
touchNow();
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
QVERIFY(windowAddedSpy.isValid());
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));
@ -281,7 +277,6 @@ void InputMethodTest::testSwitchFocusedSurfaces()
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QSignalSpy windowRemovedSpy(workspace(), &Workspace::windowRemoved);
QVERIFY(windowAddedSpy.isValid());
QSignalSpy activateSpy(kwinApp()->inputMethod(), &InputMethod::activeChanged);
std::unique_ptr<TextInput> textInput(Test::waylandTextInputManager()->createTextInput(Test::waylandSeat()));

View file

@ -180,7 +180,6 @@ void InternalWindowTest::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));
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
@ -209,7 +208,6 @@ void InternalWindowTest::cleanup()
void InternalWindowTest::testEnterLeave()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
QVERIFY(!workspace()->findInternal(nullptr));
QVERIFY(!workspace()->findInternal(&win));
@ -228,11 +226,8 @@ void InternalWindowTest::testEnterLeave()
QVERIFY(workspace()->stackingOrder().contains(window));
QSignalSpy enterSpy(&win, &HelperWindow::entered);
QVERIFY(enterSpy.isValid());
QSignalSpy leaveSpy(&win, &HelperWindow::left);
QVERIFY(leaveSpy.isValid());
QSignalSpy moveSpy(&win, &HelperWindow::mouseMoved);
QVERIFY(moveSpy.isValid());
quint32 timestamp = 1;
Test::pointerMotion(QPoint(50, 50), timestamp++);
@ -259,14 +254,11 @@ void InternalWindowTest::testEnterLeave()
void InternalWindowTest::testPointerPressRelease()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
QSignalSpy pressSpy(&win, &HelperWindow::mousePressed);
QVERIFY(pressSpy.isValid());
QSignalSpy releaseSpy(&win, &HelperWindow::mouseReleased);
QVERIFY(releaseSpy.isValid());
QTRY_COMPARE(windowAddedSpy.count(), 1);
@ -282,12 +274,10 @@ void InternalWindowTest::testPointerPressRelease()
void InternalWindowTest::testPointerAxis()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
QSignalSpy wheelSpy(&win, &HelperWindow::wheel);
QVERIFY(wheelSpy.isValid());
QTRY_COMPARE(windowAddedSpy.count(), 1);
quint32 timestamp = 1;
@ -310,14 +300,11 @@ void InternalWindowTest::testKeyboard_data()
void InternalWindowTest::testKeyboard()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
QSignalSpy pressSpy(&win, &HelperWindow::keyPressed);
QVERIFY(pressSpy.isValid());
QSignalSpy releaseSpy(&win, &HelperWindow::keyReleased);
QVERIFY(releaseSpy.isValid());
QTRY_COMPARE(windowAddedSpy.count(), 1);
auto internalWindow = windowAddedSpy.first().first().value<InternalWindow *>();
QVERIFY(internalWindow);
@ -339,15 +326,12 @@ void InternalWindowTest::testKeyboard()
void InternalWindowTest::testKeyboardShowWithoutActivating()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setProperty("_q_showWithoutActivating", true);
win.setGeometry(0, 0, 100, 100);
win.show();
QSignalSpy pressSpy(&win, &HelperWindow::keyPressed);
QVERIFY(pressSpy.isValid());
QSignalSpy releaseSpy(&win, &HelperWindow::keyReleased);
QVERIFY(releaseSpy.isValid());
QTRY_COMPARE(windowAddedSpy.count(), 1);
auto internalWindow = windowAddedSpy.first().first().value<InternalWindow *>();
QVERIFY(internalWindow);
@ -376,9 +360,7 @@ void InternalWindowTest::testKeyboardTriggersLeave()
QVERIFY(keyboard != nullptr);
QVERIFY(keyboard->isValid());
QSignalSpy enteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(leftSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
@ -395,14 +377,11 @@ void InternalWindowTest::testKeyboardTriggersLeave()
// create internal window
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
QSignalSpy pressSpy(&win, &HelperWindow::keyPressed);
QVERIFY(pressSpy.isValid());
QSignalSpy releaseSpy(&win, &HelperWindow::keyReleased);
QVERIFY(releaseSpy.isValid());
QTRY_COMPARE(windowAddedSpy.count(), 1);
auto internalWindow = windowAddedSpy.first().first().value<InternalWindow *>();
QVERIFY(internalWindow);
@ -436,18 +415,14 @@ void InternalWindowTest::testTouch()
{
// touch events for internal windows are emulated through mouse events
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
QTRY_COMPARE(windowAddedSpy.count(), 1);
QSignalSpy pressSpy(&win, &HelperWindow::mousePressed);
QVERIFY(pressSpy.isValid());
QSignalSpy releaseSpy(&win, &HelperWindow::mouseReleased);
QVERIFY(releaseSpy.isValid());
QSignalSpy moveSpy(&win, &HelperWindow::mouseMoved);
QVERIFY(moveSpy.isValid());
quint32 timestamp = 1;
QCOMPARE(win.pressedButtons(), Qt::MouseButtons());
@ -501,7 +476,6 @@ void InternalWindowTest::testOpacity()
{
// this test verifies that opacity is properly synced from QWindow to InternalClient
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setOpacity(0.5);
win.setGeometry(0, 0, 100, 100);
@ -513,7 +487,6 @@ void InternalWindowTest::testOpacity()
QCOMPARE(internalWindow->opacity(), 0.5);
QSignalSpy opacityChangedSpy(internalWindow, &InternalWindow::opacityChanged);
QVERIFY(opacityChangedSpy.isValid());
win.setOpacity(0.75);
QCOMPARE(opacityChangedSpy.count(), 1);
QCOMPARE(internalWindow->opacity(), 0.75);
@ -522,7 +495,6 @@ void InternalWindowTest::testOpacity()
void InternalWindowTest::testMove()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setOpacity(0.5);
win.setGeometry(0, 0, 100, 100);
@ -563,7 +535,6 @@ void InternalWindowTest::testSkipCloseAnimation_data()
void InternalWindowTest::testSkipCloseAnimation()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setOpacity(0.5);
win.setGeometry(0, 0, 100, 100);
@ -575,7 +546,6 @@ void InternalWindowTest::testSkipCloseAnimation()
QVERIFY(internalWindow);
QCOMPARE(internalWindow->skipsCloseAnimation(), initial);
QSignalSpy skipCloseChangedSpy(internalWindow, &Window::skipCloseAnimationChanged);
QVERIFY(skipCloseChangedSpy.isValid());
win.setProperty("KWIN_SKIP_CLOSE_ANIMATION", !initial);
QCOMPARE(skipCloseChangedSpy.count(), 1);
QCOMPARE(internalWindow->skipsCloseAnimation(), !initial);
@ -587,7 +557,6 @@ void InternalWindowTest::testSkipCloseAnimation()
void InternalWindowTest::testModifierClickUnrestrictedMove()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.setFlags(win.flags() & ~Qt::FramelessWindowHint);
@ -629,7 +598,6 @@ void InternalWindowTest::testModifierClickUnrestrictedMove()
void InternalWindowTest::testModifierScroll()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.setFlags(win.flags() & ~Qt::FramelessWindowHint);
@ -663,7 +631,6 @@ void InternalWindowTest::testModifierScroll()
void InternalWindowTest::testPopup()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.setFlags(win.flags() | Qt::Popup);
@ -682,7 +649,6 @@ void InternalWindowTest::testScale()
Q_ARG(QVector<int>, QVector<int>({2, 2})));
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.setFlags(win.flags() | Qt::Popup);
@ -718,7 +684,6 @@ void InternalWindowTest::testWindowType_data()
void InternalWindowTest::testWindowType()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
QFETCH(NET::WindowType, windowType);
@ -754,7 +719,6 @@ void InternalWindowTest::testChangeWindowType_data()
void InternalWindowTest::testChangeWindowType()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
@ -774,7 +738,6 @@ void InternalWindowTest::testChangeWindowType()
void InternalWindowTest::testEffectWindow()
{
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
@ -795,7 +758,6 @@ void InternalWindowTest::testReentrantMoveResize()
// Create an internal window.
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
@ -823,7 +785,6 @@ void InternalWindowTest::testDismissPopup()
// Create a toplevel window.
QSignalSpy windowAddedSpy(workspace(), &Workspace::internalWindowAdded);
QVERIFY(windowAddedSpy.isValid());
HelperWindow clientToplevel;
clientToplevel.setGeometry(0, 0, 100, 100);
clientToplevel.show();

View file

@ -42,8 +42,6 @@ public:
: layoutsReconfiguredSpy(this, &KeyboardLayoutTest::layoutListChanged)
, layoutChangedSpy(this, &KeyboardLayoutTest::layoutChanged)
{
QVERIFY(layoutsReconfiguredSpy.isValid());
QVERIFY(layoutChangedSpy.isValid());
QVERIFY(QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.keyboard"), QStringLiteral("/Layouts"), QStringLiteral("org.kde.KeyboardLayouts"), QStringLiteral("layoutListChanged"), this, SIGNAL(layoutListChanged())));
QVERIFY(QDBusConnection::sessionBus().connect(QStringLiteral("org.kde.keyboard"), QStringLiteral("/Layouts"), QStringLiteral("org.kde.KeyboardLayouts"), QStringLiteral("layoutChanged"), this, SIGNAL(layoutChanged(uint))));
@ -134,7 +132,6 @@ void KeyboardLayoutTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -393,7 +390,6 @@ void KeyboardLayoutTest::testVirtualDesktopPolicy()
// check there are no more layouts left in config than the last actual non-default layouts number
QSignalSpy deletedDesktopSpy(deletedDesktop, &VirtualDesktop::aboutToBeDestroyed);
QVERIFY(deletedDesktopSpy.isValid());
QVERIFY(deletedDesktopSpy.wait());
resetLayouts();
QCOMPARE(layoutGroup.keyList().filter(QStringLiteral("LayoutDefault")).count(), 1);

View file

@ -49,7 +49,6 @@ void KeymapCreationFailureTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));

View file

@ -47,7 +47,6 @@ void KWinBindingsTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -169,7 +168,6 @@ void KWinBindingsTest::testSwitchWindowScript()
auto s = Scripting::self()->findScript(tmpFile.fileName());
QVERIFY(s);
QSignalSpy runningChangedSpy(s, &AbstractScript::runningChanged);
QVERIFY(runningChangedSpy.isValid());
s->run();
QTRY_COMPARE(runningChangedSpy.count(), 1);
};
@ -219,7 +217,6 @@ void KWinBindingsTest::testWindowToDesktop()
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QSignalSpy desktopChangedSpy(window, &Window::desktopChanged);
QVERIFY(desktopChangedSpy.isValid());
QCOMPARE(workspace()->activeWindow(), window);
QFETCH(int, desktop);

View file

@ -54,7 +54,6 @@ private Q_SLOTS:
void LayerShellV1WindowTest::initTestCase()
{
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));
@ -105,7 +104,6 @@ void LayerShellV1WindowTest::testOutput()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -166,7 +164,6 @@ void LayerShellV1WindowTest::testAnchor()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
QCOMPARE(requestedSize, QSize(280, 124));
@ -239,7 +236,6 @@ void LayerShellV1WindowTest::testMargins()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -281,7 +277,6 @@ void LayerShellV1WindowTest::testLayer()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -326,7 +321,6 @@ void LayerShellV1WindowTest::testPlacementArea()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -377,7 +371,6 @@ void LayerShellV1WindowTest::testFill()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -458,7 +451,6 @@ void LayerShellV1WindowTest::testFocus()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -500,7 +492,6 @@ void LayerShellV1WindowTest::testActivate()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
const QSize requestedSize = configureRequestedSpy.last().at(1).toSize();
@ -515,7 +506,6 @@ void LayerShellV1WindowTest::testActivate()
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QSignalSpy activeChangedSpy(window, &Window::activeChanged);
QVERIFY(activeChangedSpy.isValid());
QTEST(activeChangedSpy.wait(1000), "active");
// Destroy the window.
@ -535,7 +525,6 @@ void LayerShellV1WindowTest::testUnmap()
// Wait for the compositor to position the surface.
QSignalSpy configureRequestedSpy(shellSurface.get(), &Test::LayerSurfaceV1::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
QVERIFY(configureRequestedSpy.wait());
// Map the layer surface.

View file

@ -106,7 +106,6 @@ Q_SIGNALS:
do { \
QVERIFY(!waylandServer()->isScreenLocked()); \
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged); \
QVERIFY(lockStateChangedSpy.isValid()); \
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate); \
QTRY_COMPARE(ScreenLocker::KSldApp::self()->lockState(), ScreenLocker::KSldApp::Locked); \
QVERIFY(waylandServer()->isScreenLocked()); \
@ -115,7 +114,6 @@ Q_SIGNALS:
#define UNLOCK \
do { \
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged); \
QVERIFY(lockStateChangedSpy.isValid()); \
unlock(); \
if (lockStateChangedSpy.count() != 1) { \
QVERIFY(lockStateChangedSpy.wait()); \
@ -179,7 +177,6 @@ void LockScreenTest::initTestCase()
qRegisterMetaType<KWin::ElectricBorder>("ElectricBorder");
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));
@ -219,7 +216,6 @@ void LockScreenTest::testStackingOrder()
// This test verifies that the lockscreen greeter is placed above other windows.
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
LOCK;
QVERIFY(windowAddedSpy.wait());
@ -239,9 +235,7 @@ void LockScreenTest::testPointer()
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
QVERIFY(pointer != nullptr);
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer.get(), &Pointer::left);
QVERIFY(leftSpy.isValid());
auto [window, surface] = showWindow();
QVERIFY(window);
@ -286,9 +280,7 @@ void LockScreenTest::testPointerButton()
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
QVERIFY(pointer != nullptr);
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy buttonChangedSpy(pointer.get(), &Pointer::buttonStateChanged);
QVERIFY(buttonChangedSpy.isValid());
auto [window, surface] = showWindow();
QVERIFY(window);
@ -329,9 +321,7 @@ void LockScreenTest::testPointerAxis()
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
QVERIFY(pointer != nullptr);
QSignalSpy axisChangedSpy(pointer.get(), &Pointer::axisChanged);
QVERIFY(axisChangedSpy.isValid());
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(enteredSpy.isValid());
auto [window, surface] = showWindow();
QVERIFY(window);
@ -371,11 +361,8 @@ void LockScreenTest::testKeyboard()
std::unique_ptr<Keyboard> keyboard(m_seat->createKeyboard());
QVERIFY(keyboard != nullptr);
QSignalSpy enteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(leftSpy.isValid());
QSignalSpy keyChangedSpy(keyboard.get(), &Keyboard::keyChanged);
QVERIFY(keyChangedSpy.isValid());
auto [window, surface] = showWindow();
QVERIFY(window);
@ -424,7 +411,6 @@ void LockScreenTest::testKeyboard()
void LockScreenTest::testScreenEdge()
{
QSignalSpy screenEdgeSpy(workspace()->screenEdges(), &ScreenEdges::approaching);
QVERIFY(screenEdgeSpy.isValid());
QCOMPARE(screenEdgeSpy.count(), 0);
quint32 timestamp = 1;
@ -447,7 +433,6 @@ void LockScreenTest::testEffects()
{
std::unique_ptr<HelperEffect> effect(new HelperEffect);
QSignalSpy inputSpy(effect.get(), &HelperEffect::inputEvent);
QVERIFY(inputSpy.isValid());
effects->startMouseInterception(effect.get(), Qt::ArrowCursor);
quint32 timestamp = 1;
@ -487,7 +472,6 @@ void LockScreenTest::testEffectsKeyboard()
{
std::unique_ptr<HelperEffect> effect(new HelperEffect);
QSignalSpy inputSpy(effect.get(), &HelperEffect::keyEvent);
QVERIFY(inputSpy.isValid());
effects->grabKeyboard(effect.get());
quint32 timestamp = 1;
@ -528,7 +512,6 @@ void LockScreenTest::testEffectsKeyboardAutorepeat()
// but the lock screen should filter them out
std::unique_ptr<HelperEffect> effect(new HelperEffect);
QSignalSpy inputSpy(effect.get(), &HelperEffect::keyEvent);
QVERIFY(inputSpy.isValid());
effects->grabKeyboard(effect.get());
// we need to configure the key repeat first. It is only enabled on libinput
@ -568,7 +551,6 @@ void LockScreenTest::testMoveWindow()
auto [window, surface] = showWindow();
QVERIFY(window);
QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
quint32 timestamp = 1;
workspace()->slotWindowMove();
@ -608,7 +590,6 @@ void LockScreenTest::testPointerShortcut()
using namespace KWayland::Client;
std::unique_ptr<QAction> action(new QAction(nullptr));
QSignalSpy actionSpy(action.get(), &QAction::triggered);
QVERIFY(actionSpy.isValid());
input()->registerPointerShortcut(Qt::MetaModifier, Qt::LeftButton, action.get());
// try to trigger the shortcut
@ -653,7 +634,6 @@ void LockScreenTest::testAxisShortcut()
using namespace KWayland::Client;
std::unique_ptr<QAction> action(new QAction(nullptr));
QSignalSpy actionSpy(action.get(), &QAction::triggered);
QVERIFY(actionSpy.isValid());
QFETCH(Qt::Orientation, direction);
QFETCH(int, sign);
PointerAxisDirection axisDirection = PointerAxisUp;
@ -697,7 +677,6 @@ void LockScreenTest::testKeyboardShortcut()
using namespace KWayland::Client;
std::unique_ptr<QAction> action(new QAction(nullptr));
QSignalSpy actionSpy(action.get(), &QAction::triggered);
QVERIFY(actionSpy.isValid());
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
action->setObjectName("LockScreenTest::testKeyboardShortcut");
KGlobalAccel::self()->setDefaultShortcut(action.get(), QList<QKeySequence>{Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_Space});
@ -745,11 +724,8 @@ void LockScreenTest::testTouch()
auto [window, surface] = showWindow();
QVERIFY(window);
QSignalSpy sequenceStartedSpy(touch, &Touch::sequenceStarted);
QVERIFY(sequenceStartedSpy.isValid());
QSignalSpy cancelSpy(touch, &Touch::sequenceCanceled);
QVERIFY(cancelSpy.isValid());
QSignalSpy pointRemovedSpy(touch, &Touch::pointRemoved);
QVERIFY(pointRemovedSpy.isValid());
quint32 timestamp = 1;
Test::touchDown(1, QPointF(25, 25), timestamp++);

View file

@ -49,7 +49,6 @@ void TestMaximized::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));
@ -117,11 +116,8 @@ void TestMaximized::testMaximizedPassedToDeco()
// now maximize
QSignalSpy bordersChangedSpy(decoration, &KDecoration2::Decoration::bordersChanged);
QVERIFY(bordersChangedSpy.isValid());
QSignalSpy maximizedChangedSpy(decoration->client().toStrongRef().get(), &KDecoration2::DecoratedClient::maximizedChanged);
QVERIFY(maximizedChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
workspace()->slotWindowMaximize();
QVERIFY(surfaceConfigureRequestedSpy.wait());
@ -274,7 +270,6 @@ void TestMaximized::testBorderlessMaximizedWindow()
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());

View file

@ -82,7 +82,6 @@ void Target::shortcut()
void ModifierOnlyShortcutTest::initTestCase()
{
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -131,7 +130,6 @@ void ModifierOnlyShortcutTest::testTrigger()
// this test verifies that modifier only shortcut triggers correctly
Target target;
QSignalSpy triggeredSpy(&target, &Target::shortcutTriggered);
QVERIFY(triggeredSpy.isValid());
KConfigGroup group = kwinApp()->config()->group("ModifierOnlyShortcuts");
QFETCH(QStringList, metaConfig);
@ -247,7 +245,6 @@ void ModifierOnlyShortcutTest::testCapsLock()
// but other shortcuts still trigger even when Capslock is on
Target target;
QSignalSpy triggeredSpy(&target, &Target::shortcutTriggered);
QVERIFY(triggeredSpy.isValid());
KConfigGroup group = kwinApp()->config()->group("ModifierOnlyShortcuts");
group.writeEntry("Meta", QStringList());
@ -333,7 +330,6 @@ void ModifierOnlyShortcutTest::testGlobalShortcutsDisabled()
// see BUG: 370146
Target target;
QSignalSpy triggeredSpy(&target, &Target::shortcutTriggered);
QVERIFY(triggeredSpy.isValid());
KConfigGroup group = kwinApp()->config()->group("ModifierOnlyShortcuts");
QFETCH(QStringList, metaConfig);

View file

@ -82,7 +82,6 @@ void MoveResizeWindowTest::initTestCase()
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode");
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
kwinApp()->start();
@ -123,21 +122,14 @@ void MoveResizeWindowTest::testMove()
QCOMPARE(workspace()->activeWindow(), window);
QCOMPARE(window->frameGeometry(), QRect(0, 0, 100, 50));
QSignalSpy startMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
QSignalSpy moveResizedChangedSpy(window, &Window::moveResizedChanged);
QVERIFY(moveResizedChangedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
// effects signal handlers
QSignalSpy windowStartUserMovedResizedSpy(effects, &EffectsHandler::windowStartUserMovedResized);
QVERIFY(windowStartUserMovedResizedSpy.isValid());
QSignalSpy windowStepUserMovedResizedSpy(effects, &EffectsHandler::windowStepUserMovedResized);
QVERIFY(windowStepUserMovedResizedSpy.isValid());
QSignalSpy windowFinishUserMovedResizedSpy(effects, &EffectsHandler::windowFinishUserMovedResized);
QVERIFY(windowFinishUserMovedResizedSpy.isValid());
// begin move
QVERIFY(workspace()->moveResizeWindow() == nullptr);
@ -200,9 +192,7 @@ void MoveResizeWindowTest::testResize()
// Wait for the initial configure event.
Test::XdgToplevel::States states;
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
@ -227,15 +217,10 @@ void MoveResizeWindowTest::testResize()
QCOMPARE(workspace()->activeWindow(), window);
QCOMPARE(window->frameGeometry(), QRect(0, 0, 100, 50));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy startMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(startMoveResizedSpy.isValid());
QSignalSpy moveResizedChangedSpy(window, &Window::moveResizedChanged);
QVERIFY(moveResizedChangedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
// begin resize
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
@ -453,9 +438,7 @@ void MoveResizeWindowTest::testGrowShrink()
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
QVERIFY(shellSurface != nullptr);
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
// let's render
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(toplevelConfigureRequestedSpy.wait());
@ -473,7 +456,6 @@ void MoveResizeWindowTest::testGrowShrink()
Test::render(surface.get(), toplevelConfigureRequestedSpy.last().first().toSize(), Qt::red);
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
m_connection->flush();
QVERIFY(frameGeometryChangedSpy.wait());
QTEST(window->frameGeometry(), "expectedGeometry");
@ -540,11 +522,8 @@ void MoveResizeWindowTest::testClientSideMove()
Cursors::self()->mouse()->setPos(640, 512);
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy buttonSpy(pointer.get(), &Pointer::buttonStateChanged);
QVERIFY(buttonSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
@ -561,7 +540,6 @@ void MoveResizeWindowTest::testClientSideMove()
Test::pointerButtonPressed(BTN_LEFT, timestamp++);
QVERIFY(buttonSpy.wait());
QSignalSpy moveStartSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(moveStartSpy.isValid());
shellSurface->move(*Test::waylandSeat(), buttonSpy.first().first().value<quint32>());
QVERIFY(moveStartSpy.wait());
QCOMPARE(window->isInteractiveMove(), true);
@ -569,7 +547,6 @@ void MoveResizeWindowTest::testClientSideMove()
// move a bit
QSignalSpy clientMoveStepSpy(window, &Window::clientStepUserMovedResized);
QVERIFY(clientMoveStepSpy.isValid());
const QPointF startPoint = startGeometry.center();
const int dragDistance = QApplication::startDragDistance();
// Why?
@ -653,7 +630,6 @@ void MoveResizeWindowTest::testNetMove()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
@ -665,11 +641,8 @@ void MoveResizeWindowTest::testNetMove()
QVERIFY(!origGeo.contains(Cursors::self()->mouse()->pos()));
QSignalSpy moveStartSpy(window, &X11Window::clientStartUserMovedResized);
QVERIFY(moveStartSpy.isValid());
QSignalSpy moveEndSpy(window, &X11Window::clientFinishUserMovedResized);
QVERIFY(moveEndSpy.isValid());
QSignalSpy moveStepSpy(window, &X11Window::clientStepUserMovedResized);
QVERIFY(moveStepSpy.isValid());
QVERIFY(!workspace()->moveResizeWindow());
// use NETRootInfo to trigger a move request
@ -700,7 +673,6 @@ void MoveResizeWindowTest::testNetMove()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
@ -742,7 +714,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *panel = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(panel);
@ -767,7 +738,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel()
// now let's hide the panel
QSignalSpy panelHiddenSpy(panel, &Window::windowHidden);
QVERIFY(panelHiddenSpy.isValid());
QFETCH(quint32, hideLocation);
xcb_change_property(c.get(), XCB_PROP_MODE_REPLACE, windowId, atoms->kde_screen_edge_show, XCB_ATOM_CARDINAL, 32, 1, &hideLocation);
xcb_flush(c.get());
@ -783,7 +753,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel()
c.reset();
QSignalSpy panelClosedSpy(panel, &X11Window::windowClosed);
QVERIFY(panelClosedSpy.isValid());
QVERIFY(panelClosedSpy.wait());
// snap once more
@ -791,7 +760,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingX11Panel()
// and close
QSignalSpy windowClosedSpy(testWindow, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
shellSurface.reset();
surface.reset();
QVERIFY(windowClosedSpy.wait());
@ -848,7 +816,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel()
// now let's hide the panel
QSignalSpy panelHiddenSpy(panel, &Window::windowHidden);
QVERIFY(panelHiddenSpy.isValid());
plasmaSurface->requestHideAutoHidingPanel();
QVERIFY(panelHiddenSpy.wait());
@ -857,7 +824,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel()
// and destroy the panel again
QSignalSpy panelClosedSpy(panel, &Window::windowClosed);
QVERIFY(panelClosedSpy.isValid());
plasmaSurface.reset();
panelShellSurface.reset();
panelSurface.reset();
@ -868,7 +834,6 @@ void MoveResizeWindowTest::testAdjustClientGeometryOfAutohidingWaylandPanel()
// and close
QSignalSpy windowClosedSpy(testWindow, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
shellSurface.reset();
surface.reset();
QVERIFY(windowClosedSpy.wait());
@ -917,15 +882,12 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboard()
// The client should receive a configure event upon becoming active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
surfaceConfigureRequestedSpy.clear();
window->move(windowRect.topLeft());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QCOMPARE(window->frameGeometry(), windowRect);
window->setVirtualKeyboardGeometry(keyboardRect);
@ -981,14 +943,11 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithMaximize()
// The client should receive a configure event upon becoming active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
window->move(QPoint(100, 300));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QCOMPARE(window->frameGeometry(), QRect(100, 300, 500, 800));
window->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
@ -1034,14 +993,11 @@ void MoveResizeWindowTest::testResizeForVirtualKeyboardWithFullScreen()
// The client should receive a configure event upon becoming active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
window->move(QPoint(100, 300));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QCOMPARE(window->frameGeometry(), QRect(100, 300, 500, 800));
window->setVirtualKeyboardGeometry(QRect(0, 100, 1280, 500));
@ -1086,9 +1042,7 @@ void MoveResizeWindowTest::testDestroyMoveClient()
// Start moving the client.
QSignalSpy clientStartMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QCOMPARE(window->isInteractiveMove(), false);
@ -1123,9 +1077,7 @@ void MoveResizeWindowTest::testDestroyResizeClient()
// Start resizing the client.
QSignalSpy clientStartMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QCOMPARE(window->isInteractiveMove(), false);

View file

@ -34,7 +34,6 @@ private Q_SLOTS:
void NightColorTest::initTestCase()
{
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));

View file

@ -90,7 +90,6 @@ void NoGlobalShortcutsTest::initTestCase()
{
qRegisterMetaType<KWin::ElectricBorder>("ElectricBorder");
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName, KWin::WaylandServer::InitializationFlag::NoGlobalShortcuts));
@ -139,7 +138,6 @@ void NoGlobalShortcutsTest::testTrigger()
// test based on ModifierOnlyShortcutTest::testTrigger
Target target;
QSignalSpy triggeredSpy(&target, &Target::shortcutTriggered);
QVERIFY(triggeredSpy.isValid());
KConfigGroup group = kwinApp()->config()->group("ModifierOnlyShortcuts");
QFETCH(QStringList, metaConfig);
@ -175,7 +173,6 @@ void NoGlobalShortcutsTest::testKGlobalAccel()
action->setProperty("componentName", QStringLiteral(KWIN_NAME));
action->setObjectName(QStringLiteral("globalshortcuts-test-meta-shift-w"));
QSignalSpy triggeredSpy(action.get(), &QAction::triggered);
QVERIFY(triggeredSpy.isValid());
KGlobalAccel::self()->setShortcut(action.get(), QList<QKeySequence>{Qt::META | Qt::SHIFT | Qt::Key_W}, KGlobalAccel::NoAutoloading);
input()->registerShortcut(Qt::META | Qt::SHIFT | Qt::Key_W, action.get());
@ -201,7 +198,6 @@ void NoGlobalShortcutsTest::testPointerShortcut()
// based on LockScreenTest::testPointerShortcut
std::unique_ptr<QAction> action(new QAction(nullptr));
QSignalSpy actionSpy(action.get(), &QAction::triggered);
QVERIFY(actionSpy.isValid());
input()->registerPointerShortcut(Qt::MetaModifier, Qt::LeftButton, action.get());
// try to trigger the shortcut
@ -232,7 +228,6 @@ void NoGlobalShortcutsTest::testAxisShortcut()
// based on LockScreenTest::testAxisShortcut
std::unique_ptr<QAction> action(new QAction(nullptr));
QSignalSpy actionSpy(action.get(), &QAction::triggered);
QVERIFY(actionSpy.isValid());
QFETCH(Qt::Orientation, direction);
QFETCH(int, sign);
PointerAxisDirection axisDirection = PointerAxisUp;
@ -262,7 +257,6 @@ void NoGlobalShortcutsTest::testScreenEdge()
{
// based on LockScreenTest::testScreenEdge
QSignalSpy screenEdgeSpy(workspace()->screenEdges(), &ScreenEdges::approaching);
QVERIFY(screenEdgeSpy.isValid());
QCOMPARE(screenEdgeSpy.count(), 0);
quint32 timestamp = 1;

View file

@ -46,7 +46,6 @@ void OutputChangesTest::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));

View file

@ -79,7 +79,6 @@ void TestPlacement::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));

View file

@ -60,7 +60,6 @@ void PlasmaSurfaceTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
kwinApp()->start();
@ -116,7 +115,6 @@ void PlasmaSurfaceTest::testRoleOnAllDesktops()
// now let's try to change that
QSignalSpy onAllDesktopsSpy(window, &Window::desktopChanged);
QVERIFY(onAllDesktopsSpy.isValid());
QFETCH(KWayland::Client::PlasmaShellSurface::Role, role);
plasmaSurface->setRole(role);
QFETCH(bool, expectedOnAllDesktops);
@ -208,7 +206,6 @@ void PlasmaSurfaceTest::testOSDPlacement()
// change size of window
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
Test::render(surface.get(), QSize(200, 100), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(window->frameGeometry(), QRect(1280 / 2 - 200 / 2, 2 * 1024 / 3 - 100 / 2, 200, 100));
@ -351,7 +348,6 @@ void PlasmaSurfaceTest::testPanelWindowsCanCover()
QCOMPARE(stackingOrder.last(), window);
QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged);
QVERIFY(stackingOrderChangedSpy.isValid());
// trigger screenedge
QFETCH(QPoint, triggerPoint);
KWin::Cursors::self()->mouse()->setPos(triggerPoint);

View file

@ -60,7 +60,6 @@ void PlasmaWindowTest::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));
@ -94,7 +93,6 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
{
// this test verifies that a PlasmaWindow gets unmapped on Client side when an X11 window is destroyed
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
// create an xcb window
struct XcbConnectionDeleter
@ -124,7 +122,6 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
// 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);
@ -146,12 +143,9 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
auto pw = m_windowManagement->windows().first();
QCOMPARE(pw->geometry(), window->frameGeometry());
QSignalSpy geometryChangedSpy(pw, &PlasmaWindow::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
QSignalSpy unmappedSpy(m_windowManagement->windows().first(), &PlasmaWindow::unmapped);
QVERIFY(unmappedSpy.isValid());
QSignalSpy destroyedSpy(m_windowManagement->windows().first(), &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
// now shade the window
const QRectF geoBeforeShade = window->frameGeometry();
@ -174,7 +168,6 @@ void PlasmaWindowTest::testCreateDestroyX11PlasmaWindow()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
xcb_destroy_window(c.get(), windowId);
c.reset();
@ -214,7 +207,6 @@ void PlasmaWindowTest::testInternalWindowNoPlasmaWindow()
{
// this test verifies that an internal window is not added as a PlasmaWindow
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.show();
@ -226,7 +218,6 @@ void PlasmaWindowTest::testPopupWindowNoPlasmaWindow()
{
// this test verifies that a popup window is not added as a PlasmaWindow
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
// first create the parent window
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
@ -261,11 +252,9 @@ void PlasmaWindowTest::testLockScreenNoPlasmaWindow()
#if KWIN_BUILD_SCREENLOCKER
// this test verifies that lock screen windows are not exposed to PlasmaWindow
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
// this time we use a QSignalSpy on XdgShellClient as it'a a little bit more complex setup
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
// lock
ScreenLocker::KSldApp::self()->lock(ScreenLocker::EstablishLock::Immediate);
QVERIFY(windowAddedSpy.wait());
@ -276,7 +265,6 @@ void PlasmaWindowTest::testLockScreenNoPlasmaWindow()
// fake unlock
QSignalSpy lockStateChangedSpy(ScreenLocker::KSldApp::self(), &ScreenLocker::KSldApp::lockStateChanged);
QVERIFY(lockStateChangedSpy.isValid());
const auto children = ScreenLocker::KSldApp::self()->children();
for (auto it = children.begin(); it != children.end(); ++it) {
if (qstrcmp((*it)->metaObject()->className(), "LogindIntegration") != 0) {
@ -297,7 +285,6 @@ void PlasmaWindowTest::testDestroyedButNotUnmapped()
// this test verifies that also when a ShellSurface gets destroyed without a prior unmap
// the PlasmaWindow gets destroyed on Client side
QSignalSpy plasmaWindowCreatedSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(plasmaWindowCreatedSpy.isValid());
// first create the parent window
std::unique_ptr<KWayland::Client::Surface> parentSurface(Test::createSurface());
@ -310,7 +297,6 @@ void PlasmaWindowTest::testDestroyedButNotUnmapped()
auto window = plasmaWindowCreatedSpy.first().first().value<PlasmaWindow *>();
QVERIFY(window);
QSignalSpy destroyedSpy(window, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
// now destroy without an unmap
parentShellSurface.reset();

View file

@ -28,7 +28,6 @@ private Q_SLOTS:
void PlatformCursorTest::initTestCase()
{
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
kwinApp()->start();

View file

@ -59,7 +59,6 @@ void TestPointerConstraints::initTestCase()
qRegisterMetaType<PointerFunc>();
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));
@ -127,9 +126,7 @@ void TestPointerConstraints::testConfinedPointer()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<ConfinedPointer> confinedPointer(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot));
QSignalSpy confinedSpy(confinedPointer.get(), &ConfinedPointer::confined);
QVERIFY(confinedSpy.isValid());
QSignalSpy unconfinedSpy(confinedPointer.get(), &ConfinedPointer::unconfined);
QVERIFY(unconfinedSpy.isValid());
// now map the window
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
@ -147,7 +144,6 @@ void TestPointerConstraints::testConfinedPointer()
// picking a position outside the window geometry should not move pointer
QSignalSpy pointerPositionChangedSpy(input(), &InputRedirection::globalPointerChanged);
QVERIFY(pointerPositionChangedSpy.isValid());
KWin::Cursors::self()->mouse()->setPos(QPoint(512, 512));
QVERIFY(pointerPositionChangedSpy.isEmpty());
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), window->frameGeometry().center());
@ -210,9 +206,7 @@ void TestPointerConstraints::testConfinedPointer()
// reconfine pointer (this time with persistent life time)
confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent));
QSignalSpy confinedSpy2(confinedPointer.get(), &ConfinedPointer::confined);
QVERIFY(confinedSpy2.isValid());
QSignalSpy unconfinedSpy2(confinedPointer.get(), &ConfinedPointer::unconfined);
QVERIFY(unconfinedSpy2.isValid());
// activate it again, this confines again
workspace()->activateWindow(static_cast<Window *>(input()->pointer()->focus()));
@ -256,7 +250,6 @@ void TestPointerConstraints::testConfinedPointer()
Test::flushWaylandConnection();
QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged);
QVERIFY(constraintsChangedSpy.isValid());
QVERIFY(constraintsChangedSpy.wait());
// should be unconfined
@ -265,7 +258,6 @@ void TestPointerConstraints::testConfinedPointer()
// confine again
confinedPointer.reset(Test::waylandPointerConstraints()->confinePointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent));
QSignalSpy confinedSpy3(confinedPointer.get(), &ConfinedPointer::confined);
QVERIFY(confinedSpy3.isValid());
QVERIFY(confinedSpy3.wait());
QCOMPARE(input()->pointer()->isConstrained(), true);
@ -286,9 +278,7 @@ void TestPointerConstraints::testLockedPointer()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<LockedPointer> lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot));
QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked);
QVERIFY(lockedSpy.isValid());
QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked);
QVERIFY(unlockedSpy.isValid());
// now map the window
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);
@ -318,7 +308,6 @@ void TestPointerConstraints::testLockedPointer()
lockedPointer.reset(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::Persistent));
QSignalSpy lockedSpy2(lockedPointer.get(), &LockedPointer::locked);
QVERIFY(lockedSpy2.isValid());
// activate the window again, this should lock again
workspace()->activateWindow(static_cast<Window *>(input()->pointer()->focus()));
@ -335,7 +324,6 @@ void TestPointerConstraints::testLockedPointer()
Test::flushWaylandConnection();
QSignalSpy constraintsChangedSpy(input()->pointer()->focus()->surface(), &KWaylandServer::SurfaceInterface::pointerConstraintsChanged);
QVERIFY(constraintsChangedSpy.isValid());
QVERIFY(constraintsChangedSpy.wait());
// moving cursor should be allowed again
@ -352,9 +340,7 @@ void TestPointerConstraints::testCloseWindowWithLockedPointer()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<LockedPointer> lockedPointer(Test::waylandPointerConstraints()->lockPointer(surface.get(), pointer.get(), nullptr, PointerConstraints::LifeTime::OneShot));
QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked);
QVERIFY(lockedSpy.isValid());
QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked);
QVERIFY(unlockedSpy.isValid());
// now map the window
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 100), Qt::blue);

View file

@ -135,7 +135,6 @@ void PointerInputTest::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));
@ -192,13 +191,10 @@ void PointerInputTest::testWarpingUpdatesFocus()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -240,13 +236,10 @@ void PointerInputTest::testWarpingGeneratesPointerMotion()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy movedSpy(pointer, &Pointer::motion);
QVERIFY(movedSpy.isValid());
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -279,14 +272,12 @@ void PointerInputTest::testWarpingDuringFilter()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy movedSpy(pointer, &Pointer::motion);
QVERIFY(movedSpy.isValid());
// warp cursor into expected geometry
Cursors::self()->mouse()->setPos(10, 10);
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -366,13 +357,10 @@ void PointerInputTest::testUpdateFocusAfterScreenChange()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -416,7 +404,6 @@ void PointerInputTest::testUpdateFocusOnDecorationDestroy()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy buttonStateChangedSpy(pointer, &KWayland::Client::Pointer::buttonStateChanged);
QVERIFY(buttonStateChangedSpy.isValid());
// Enable the borderless maximized windows option.
auto group = kwinApp()->config()->group("Windows");
@ -476,7 +463,6 @@ void PointerInputTest::testUpdateFocusOnDecorationDestroy()
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
@ -546,7 +532,6 @@ void PointerInputTest::testModifierClickUnrestrictedMove()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonSpy.isValid());
// first modify the config for this run
QFETCH(QString, modKey);
@ -564,7 +549,6 @@ void PointerInputTest::testModifierClickUnrestrictedMove()
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -665,7 +649,6 @@ void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled(
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonSpy.isValid());
// first modify the config for this run
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
@ -682,7 +665,6 @@ void PointerInputTest::testModifierClickUnrestrictedMoveGlobalShortcutsDisabled(
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -743,7 +725,6 @@ void PointerInputTest::testModifierScrollOpacity()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy axisSpy(pointer, &Pointer::axisChanged);
QVERIFY(axisSpy.isValid());
// first modify the config for this run
QFETCH(QString, modKey);
@ -755,7 +736,6 @@ void PointerInputTest::testModifierScrollOpacity()
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -803,7 +783,6 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy axisSpy(pointer, &Pointer::axisChanged);
QVERIFY(axisSpy.isValid());
// first modify the config for this run
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
@ -814,7 +793,6 @@ void PointerInputTest::testModifierScrollOpacityGlobalShortcutsDisabled()
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -855,7 +833,6 @@ void PointerInputTest::testScrollAction()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy axisSpy(pointer, &Pointer::axisChanged);
QVERIFY(axisSpy.isValid());
// first modify the config for this run
KConfigGroup group = kwinApp()->config()->group("MouseBindings");
@ -864,7 +841,6 @@ void PointerInputTest::testScrollAction()
workspace()->slotReconfigure();
// create two windows
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface1 = Test::createSurface();
QVERIFY(surface1);
Test::XdgToplevel *shellSurface1 = Test::createXdgToplevelSurface(surface1.get(), surface1.get());
@ -924,7 +900,6 @@ void PointerInputTest::testFocusFollowsMouse()
// create two windows
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface1 = Test::createSurface();
QVERIFY(surface1);
Test::XdgToplevel *shellSurface1 = Test::createXdgToplevelSurface(surface1.get(), surface1.get());
@ -948,9 +923,7 @@ void PointerInputTest::testFocusFollowsMouse()
// signal spies for active window changed and stacking order changed
QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::windowActivated);
QVERIFY(activeWindowChangedSpy.isValid());
QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged);
QVERIFY(stackingOrderChangedSpy.isValid());
QVERIFY(!window1->isActive());
QVERIFY(window2->isActive());
@ -1010,7 +983,6 @@ void PointerInputTest::testMouseActionInactiveWindow()
// create two windows
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface1 = Test::createSurface();
QVERIFY(surface1);
Test::XdgToplevel *shellSurface1 = Test::createXdgToplevelSurface(surface1.get(), surface1.get());
@ -1034,9 +1006,7 @@ void PointerInputTest::testMouseActionInactiveWindow()
// signal spies for active window changed and stacking order changed
QSignalSpy activeWindowChangedSpy(workspace(), &Workspace::windowActivated);
QVERIFY(activeWindowChangedSpy.isValid());
QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged);
QVERIFY(stackingOrderChangedSpy.isValid());
QVERIFY(!window1->isActive());
QVERIFY(window2->isActive());
@ -1088,7 +1058,6 @@ void PointerInputTest::testMouseActionActiveWindow()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy buttonSpy(pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonSpy.isValid());
// adjust config for this run
QFETCH(bool, clickRaise);
@ -1100,7 +1069,6 @@ void PointerInputTest::testMouseActionActiveWindow()
// create two windows
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface1 = Test::createSurface();
QVERIFY(surface1);
Test::XdgToplevel *shellSurface1 = Test::createXdgToplevelSurface(surface1.get(), surface1.get());
@ -1110,7 +1078,6 @@ void PointerInputTest::testMouseActionActiveWindow()
Window *window1 = workspace()->activeWindow();
QVERIFY(window1);
QSignalSpy window1DestroyedSpy(window1, &QObject::destroyed);
QVERIFY(window1DestroyedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface2 = Test::createSurface();
QVERIFY(surface2);
Test::XdgToplevel *shellSurface2 = Test::createXdgToplevelSurface(surface2.get(), surface2.get());
@ -1121,7 +1088,6 @@ void PointerInputTest::testMouseActionActiveWindow()
QVERIFY(window2);
QVERIFY(window1 != window2);
QSignalSpy window2DestroyedSpy(window2, &QObject::destroyed);
QVERIFY(window2DestroyedSpy.isValid());
QCOMPARE(workspace()->topWindowOnDesktop(VirtualDesktopManager::self()->currentDesktop()), window2);
// geometry of the two windows should be overlapping
QVERIFY(window1->frameGeometry().intersects(window2->frameGeometry()));
@ -1131,7 +1097,6 @@ void PointerInputTest::testMouseActionActiveWindow()
// signal spy for stacking order spy
QSignalSpy stackingOrderChangedSpy(workspace(), &Workspace::stackingOrderChanged);
QVERIFY(stackingOrderChangedSpy.isValid());
// move on top of second window
QVERIFY(!window1->frameGeometry().contains(900, 900));
@ -1170,7 +1135,6 @@ void PointerInputTest::testCursorImage()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
// move cursor somewhere the new window won't open
auto cursor = Cursors::self()->mouse();
@ -1182,7 +1146,6 @@ void PointerInputTest::testCursorImage()
// create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -1202,7 +1165,6 @@ void PointerInputTest::testCursorImage()
auto cursorSurface = Test::createSurface();
QVERIFY(cursorSurface);
QSignalSpy cursorRenderedSpy(cursorSurface.get(), &KWayland::Client::Surface::frameRendered);
QVERIFY(cursorRenderedSpy.isValid());
QImage red = QImage(QSize(10, 10), QImage::Format_ARGB32_Premultiplied);
red.fill(Qt::red);
cursorSurface->attachBuffer(Test::waylandShmPool()->createBuffer(red));
@ -1276,9 +1238,7 @@ void PointerInputTest::testEffectOverrideCursorImage()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
// move cursor somewhere the new window won't open
cursor->setPos(800, 800);
// here we should have the fallback cursor
@ -1287,7 +1247,6 @@ void PointerInputTest::testEffectOverrideCursorImage()
// now let's create a window
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -1352,18 +1311,13 @@ void PointerInputTest::testPopup()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
QSignalSpy buttonStateChangedSpy(pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonStateChangedSpy.isValid());
QSignalSpy motionSpy(pointer, &Pointer::motion);
QVERIFY(motionSpy.isValid());
Cursors::self()->mouse()->setPos(800, 800);
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -1394,7 +1348,6 @@ void PointerInputTest::testPopup()
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
QVERIFY(popupShellSurface);
QSignalSpy doneReceivedSpy(popupShellSurface, &Test::XdgPopup::doneReceived);
QVERIFY(doneReceivedSpy.isValid());
popupShellSurface->grab(*Test::waylandSeat(), 0); // FIXME: Serial.
render(popupSurface.get(), QSize(100, 50));
QVERIFY(windowAddedSpy.wait());
@ -1436,13 +1389,9 @@ void PointerInputTest::testDecoCancelsPopup()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
QSignalSpy buttonStateChangedSpy(pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonStateChangedSpy.isValid());
QSignalSpy motionSpy(pointer, &Pointer::motion);
QVERIFY(motionSpy.isValid());
Cursors::self()->mouse()->setPos(800, 800);
@ -1481,7 +1430,6 @@ void PointerInputTest::testDecoCancelsPopup()
Test::XdgPopup *popupShellSurface = Test::createXdgPopupSurface(popupSurface.get(), shellSurface->xdgSurface(), positioner.get());
QVERIFY(popupShellSurface);
QSignalSpy doneReceivedSpy(popupShellSurface, &Test::XdgPopup::doneReceived);
QVERIFY(doneReceivedSpy.isValid());
popupShellSurface->grab(*Test::waylandSeat(), 0); // FIXME: Serial.
auto popupWindow = Test::renderAndWaitForShown(popupSurface.get(), QSize(100, 50), Qt::red);
QVERIFY(popupWindow);
@ -1511,13 +1459,10 @@ void PointerInputTest::testWindowUnderCursorWhileButtonPressed()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer, &Pointer::left);
QVERIFY(leftSpy.isValid());
Cursors::self()->mouse()->setPos(800, 800);
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface = Test::createSurface();
QVERIFY(surface);
Test::XdgToplevel *shellSurface = Test::createXdgToplevelSurface(surface.get(), surface.get());
@ -1692,7 +1637,6 @@ void PointerInputTest::testResizeCursor()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
QVERIFY(enteredSpy.isValid());
// create a test window
using namespace KWayland::Client;
@ -1730,7 +1674,6 @@ void PointerInputTest::testResizeCursor()
std::unique_ptr<KWayland::Client::Surface> cursorSurface(Test::createSurface());
QVERIFY(cursorSurface);
QSignalSpy cursorRenderedSpy(cursorSurface.get(), &KWayland::Client::Surface::frameRendered);
QVERIFY(cursorRenderedSpy.isValid());
cursorSurface->attachBuffer(Test::waylandShmPool()->createBuffer(arrowCursor.image()));
cursorSurface->damage(arrowCursor.image().rect());
cursorSurface->commit();
@ -1782,7 +1725,6 @@ void PointerInputTest::testMoveCursor()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy enteredSpy(pointer, &KWayland::Client::Pointer::entered);
QVERIFY(enteredSpy.isValid());
// create a test window
using namespace KWayland::Client;
@ -1801,7 +1743,6 @@ void PointerInputTest::testMoveCursor()
std::unique_ptr<KWayland::Client::Surface> cursorSurface = Test::createSurface();
QVERIFY(cursorSurface);
QSignalSpy cursorRenderedSpy(cursorSurface.get(), &KWayland::Client::Surface::frameRendered);
QVERIFY(cursorRenderedSpy.isValid());
cursorSurface->attachBuffer(Test::waylandShmPool()->createBuffer(arrowCursor.image()));
cursorSurface->damage(arrowCursor.image().rect());
cursorSurface->commit();

View file

@ -83,7 +83,6 @@ void QuickTilingTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<KWin::MaximizeMode>("MaximizeMode");
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));
@ -165,14 +164,11 @@ void QuickTilingTest::testQuickTiling()
// We have to receive a configure event when the window becomes active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QFETCH(QuickTileMode, mode);
QFETCH(QRectF, expectedGeometry);
@ -242,18 +238,13 @@ void QuickTilingTest::testQuickMaximizing()
// We have to receive a configure event upon becoming active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy maximizeChangedSpy1(window, qOverload<Window *, MaximizeMode>(&Window::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy1.isValid());
QSignalSpy maximizeChangedSpy2(window, qOverload<Window *, bool, bool>(&Window::clientMaximizedStateChanged));
QVERIFY(maximizeChangedSpy2.isValid());
window->setQuickTileMode(QuickTileFlag::Maximize, true);
QCOMPARE(quickTileChangedSpy.count(), 1);
@ -350,7 +341,6 @@ void QuickTilingTest::testQuickTilingKeyboardMove()
QCOMPARE(window->maximizeMode(), MaximizeRestore);
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
workspace()->performWindowOperation(window, Options::UnrestrictedMoveOp);
QCOMPARE(window, workspace()->moveResizeWindow());
@ -491,9 +481,7 @@ void QuickTilingTest::testQuickTilingTouchMove()
// wait for the initial configure event
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
@ -515,7 +503,6 @@ void QuickTilingTest::testQuickTilingTouchMove()
QTRY_COMPARE(surfaceConfigureRequestedSpy.count(), 2);
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
// Note that interactive move will be started with a delay.
quint32 timestamp = 1;
@ -593,7 +580,6 @@ void QuickTilingTest::testX11QuickTiling()
// 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);
@ -601,7 +587,6 @@ void QuickTilingTest::testX11QuickTiling()
// now quick tile
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
const QRectF origGeo = window->frameGeometry();
QFETCH(QuickTileMode, mode);
window->setQuickTileMode(mode, true);
@ -627,7 +612,6 @@ void QuickTilingTest::testX11QuickTiling()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
@ -675,7 +659,6 @@ void QuickTilingTest::testX11QuickTilingAfterVertMaximize()
// 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);
@ -691,7 +674,6 @@ void QuickTilingTest::testX11QuickTilingAfterVertMaximize()
// now quick tile
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QFETCH(QuickTileMode, mode);
window->setQuickTileMode(mode, true);
QCOMPARE(window->quickTileMode(), mode);
@ -706,7 +688,6 @@ void QuickTilingTest::testX11QuickTilingAfterVertMaximize()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
@ -752,9 +733,7 @@ void QuickTilingTest::testShortcut()
// We have to receive a configure event when the window becomes active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
@ -779,7 +758,6 @@ void QuickTilingTest::testShortcut()
}
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QTRY_COMPARE(quickTileChangedSpy.count(), numberOfQuickTileActions);
// at this point the geometry did not yet change
QCOMPARE(window->frameGeometry(), QRect(0, 0, 100, 50));
@ -793,7 +771,6 @@ void QuickTilingTest::testShortcut()
// attach a new image
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), expectedGeometry.size(), Qt::red);
@ -839,16 +816,12 @@ void QuickTilingTest::testScript()
// We have to receive a configure event upon the window becoming active.
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QVERIFY(toplevelConfigureRequestedSpy.isValid());
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
QSignalSpy quickTileChangedSpy(window, &Window::quickTileModeChanged);
QVERIFY(quickTileChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QVERIFY(Scripting::self());
QTemporaryFile tmpFile;
@ -868,7 +841,6 @@ void QuickTilingTest::testScript()
auto s = Scripting::self()->findScript(tmpFile.fileName());
QVERIFY(s);
QSignalSpy runningChangedSpy(s, &AbstractScript::runningChanged);
QVERIFY(runningChangedSpy.isValid());
s->run();
QVERIFY(quickTileChangedSpy.wait());

View file

@ -59,7 +59,6 @@ void SceneQPainterTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -107,7 +106,6 @@ void SceneQPainterTest::testStartFrame()
QVERIFY(scene);
QCOMPARE(kwinApp()->platform()->selectedCompositor(), QPainterCompositing);
QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
QVERIFY(frameRenderedSpy.wait());
// now let's render a reference image for comparison
QImage referenceImage(QSize(1280, 1024), QImage::Format_RGB32);
@ -128,7 +126,6 @@ void SceneQPainterTest::testCursorMoving()
auto scene = Compositor::self()->scene();
QVERIFY(scene);
QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
KWin::Cursors::self()->mouse()->setPos(0, 0);
QVERIFY(frameRenderedSpy.wait());
KWin::Cursors::self()->mouse()->setPos(10, 0);
@ -168,7 +165,6 @@ void SceneQPainterTest::testWindow()
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
// now let's map the window
QVERIFY(Test::renderAndWaitForShown(s.get(), QSize(200, 300), Qt::blue));
@ -210,12 +206,10 @@ void SceneQPainterTest::testWindowScaled()
std::unique_ptr<Test::XdgToplevel> ss(Test::createXdgToplevelSurface(s.get()));
std::unique_ptr<Pointer> p(Test::waylandSeat()->createPointer());
QSignalSpy pointerEnteredSpy(p.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
auto scene = KWin::Compositor::self()->scene();
QVERIFY(scene);
QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
// now let's set a cursor image
std::unique_ptr<KWayland::Client::Surface> cs(Test::createSurface());
@ -266,7 +260,6 @@ void SceneQPainterTest::testCompositorRestart()
auto oldScene = KWin::Compositor::self()->scene();
QVERIFY(oldScene);
QSignalSpy sceneCreatedSpy(KWin::Compositor::self(), &KWin::Compositor::sceneCreated);
QVERIFY(sceneCreatedSpy.isValid());
KWin::Compositor::self()->reinitialize();
if (sceneCreatedSpy.isEmpty()) {
QVERIFY(sceneCreatedSpy.wait());
@ -278,7 +271,6 @@ void SceneQPainterTest::testCompositorRestart()
// this should directly trigger a frame
KWin::Compositor::self()->scene()->addRepaintFull();
QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
QVERIFY(frameRenderedSpy.wait());
// render reference image
@ -330,7 +322,6 @@ void SceneQPainterTest::testX11Window()
// create X11 window
QSignalSpy windowAddedSpy(effects, &EffectsHandler::windowAdded);
QVERIFY(windowAddedSpy.isValid());
// create an xcb window
std::unique_ptr<xcb_connection_t, XcbConnectionDeleter> c(xcb_connect(nullptr, nullptr));
@ -354,7 +345,6 @@ void SceneQPainterTest::testX11Window()
// 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 +366,6 @@ void SceneQPainterTest::testX11Window()
// this should directly trigger a frame
KWin::Compositor::self()->scene()->addRepaintFull();
QSignalSpy frameRenderedSpy(scene, &Scene::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
QVERIFY(frameRenderedSpy.wait());
const QPointF startPos = window->pos() + window->clientPos();
@ -388,7 +377,6 @@ void SceneQPainterTest::testX11Window()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
xcb_destroy_window(c.get(), windowId);
c.reset();

View file

@ -37,7 +37,6 @@ private Q_SLOTS:
void ScreenChangesTest::initTestCase()
{
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -66,11 +65,8 @@ void ScreenChangesTest::testScreenAddRemove()
// first create a registry to get signals about Outputs announced/removed
Registry registry;
QSignalSpy allAnnounced(&registry, &Registry::interfacesAnnounced);
QVERIFY(allAnnounced.isValid());
QSignalSpy outputAnnouncedSpy(&registry, &Registry::outputAnnounced);
QVERIFY(outputAnnouncedSpy.isValid());
QSignalSpy outputRemovedSpy(&registry, &Registry::outputRemoved);
QVERIFY(outputRemovedSpy.isValid());
registry.create(Test::waylandConnection());
QVERIFY(registry.isValid());
registry.setup();
@ -118,7 +114,6 @@ void ScreenChangesTest::testScreenAddRemove()
std::unique_ptr<KWayland::Client::Output> o1(registry.createOutput(outputAnnouncedSpy.first().first().value<quint32>(), outputAnnouncedSpy.first().last().value<quint32>()));
QVERIFY(o1->isValid());
QSignalSpy o1ChangedSpy(o1.get(), &KWayland::Client::Output::changed);
QVERIFY(o1ChangedSpy.isValid());
QVERIFY(o1ChangedSpy.wait());
KWin::Output *serverOutput1 = kwinApp()->platform()->findOutput(o1->name()); // use wl_output.name to find the compositor side output
QCOMPARE(o1->globalPosition(), serverOutput1->geometry().topLeft());
@ -126,7 +121,6 @@ void ScreenChangesTest::testScreenAddRemove()
std::unique_ptr<KWayland::Client::Output> o2(registry.createOutput(outputAnnouncedSpy.last().first().value<quint32>(), outputAnnouncedSpy.last().last().value<quint32>()));
QVERIFY(o2->isValid());
QSignalSpy o2ChangedSpy(o2.get(), &KWayland::Client::Output::changed);
QVERIFY(o2ChangedSpy.isValid());
QVERIFY(o2ChangedSpy.wait());
KWin::Output *serverOutput2 = kwinApp()->platform()->findOutput(o2->name()); // use wl_output.name to find the compositor side output
QCOMPARE(o2->globalPosition(), serverOutput2->geometry().topLeft());
@ -135,13 +129,11 @@ void ScreenChangesTest::testScreenAddRemove()
// and check XDGOutput is synced
std::unique_ptr<XdgOutput> xdgO1(xdgOutputManager->getXdgOutput(o1.get()));
QSignalSpy xdgO1ChangedSpy(xdgO1.get(), &XdgOutput::changed);
QVERIFY(xdgO1ChangedSpy.isValid());
QVERIFY(xdgO1ChangedSpy.wait());
QCOMPARE(xdgO1->logicalPosition(), serverOutput1->geometry().topLeft());
QCOMPARE(xdgO1->logicalSize(), serverOutput1->geometry().size());
std::unique_ptr<XdgOutput> xdgO2(xdgOutputManager->getXdgOutput(o2.get()));
QSignalSpy xdgO2ChangedSpy(xdgO2.get(), &XdgOutput::changed);
QVERIFY(xdgO2ChangedSpy.isValid());
QVERIFY(xdgO2ChangedSpy.wait());
QCOMPARE(xdgO2->logicalPosition(), serverOutput2->geometry().topLeft());
QCOMPARE(xdgO2->logicalSize(), serverOutput2->geometry().size());
@ -155,9 +147,7 @@ void ScreenChangesTest::testScreenAddRemove()
outputRemovedSpy.clear();
QSignalSpy o1RemovedSpy(o1.get(), &KWayland::Client::Output::removed);
QVERIFY(o1RemovedSpy.isValid());
QSignalSpy o2RemovedSpy(o2.get(), &KWayland::Client::Output::removed);
QVERIFY(o2RemovedSpy.isValid());
const QVector<QRect> geometries2{QRect(0, 0, 1280, 1024)};
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs",

View file

@ -43,7 +43,6 @@ void ScreenEdgeClientShowTest::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));
@ -125,7 +124,6 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -135,7 +133,6 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11()
QVERIFY(!window->isHiddenInternal());
QSignalSpy effectsWindowAdded(effects, &EffectsHandler::windowAdded);
QVERIFY(effectsWindowAdded.isValid());
QVERIFY(effectsWindowAdded.wait());
// now try to hide
@ -144,16 +141,13 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11()
xcb_flush(c.get());
QSignalSpy effectsWindowHiddenSpy(effects, &EffectsHandler::windowHidden);
QVERIFY(effectsWindowHiddenSpy.isValid());
QSignalSpy clientHiddenSpy(window, &X11Window::windowHidden);
QVERIFY(clientHiddenSpy.isValid());
QVERIFY(clientHiddenSpy.wait());
QVERIFY(window->isHiddenInternal());
QCOMPARE(effectsWindowHiddenSpy.count(), 1);
// now trigger the edge
QSignalSpy effectsWindowShownSpy(effects, &EffectsHandler::windowShown);
QVERIFY(effectsWindowShownSpy.isValid());
QFETCH(QPoint, triggerPos);
Cursors::self()->mouse()->setPos(triggerPos);
QVERIFY(!window->isHiddenInternal());
@ -177,7 +171,6 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11()
// destroy window again
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -229,7 +222,6 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -239,7 +231,6 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch()
QVERIFY(!window->isHiddenInternal());
QSignalSpy effectsWindowAdded(effects, &EffectsHandler::windowAdded);
QVERIFY(effectsWindowAdded.isValid());
QVERIFY(effectsWindowAdded.wait());
// now try to hide
@ -248,16 +239,13 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch()
xcb_flush(c.get());
QSignalSpy effectsWindowHiddenSpy(effects, &EffectsHandler::windowHidden);
QVERIFY(effectsWindowHiddenSpy.isValid());
QSignalSpy clientHiddenSpy(window, &X11Window::windowHidden);
QVERIFY(clientHiddenSpy.isValid());
QVERIFY(clientHiddenSpy.wait());
QVERIFY(window->isHiddenInternal());
QCOMPARE(effectsWindowHiddenSpy.count(), 1);
// now trigger the edge
QSignalSpy effectsWindowShownSpy(effects, &EffectsHandler::windowShown);
QVERIFY(effectsWindowShownSpy.isValid());
quint32 timestamp = 0;
QFETCH(QPoint, touchDownPos);
QFETCH(QPoint, targetPos);
@ -270,7 +258,6 @@ void ScreenEdgeClientShowTest::testScreenEdgeShowX11Touch()
// destroy window again
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());

View file

@ -68,7 +68,6 @@ void ScreenEdgesTest::initTestCase()
qRegisterMetaType<KWin::ElectricBorder>("ElectricBorder");
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));

View file

@ -44,7 +44,6 @@ void ScreensTest::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));
@ -129,7 +128,6 @@ void ScreensTest::testCurrentWithFollowsMouse_data()
void ScreensTest::testCurrentWithFollowsMouse()
{
QSignalSpy changedSpy(workspace()->screens(), &Screens::changed);
QVERIFY(changedSpy.isValid());
// Enable "active screen follows mouse"
auto group = kwinApp()->config()->group("Windows");
@ -166,7 +164,6 @@ void ScreensTest::testCurrentPoint_data()
void ScreensTest::testCurrentPoint()
{
QSignalSpy changedSpy(workspace()->screens(), &KWin::Screens::changed);
QVERIFY(changedSpy.isValid());
QFETCH(QVector<QRect>, geometries);
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::QueuedConnection,

View file

@ -46,7 +46,6 @@ void MinimizeAllScriptTest::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));
@ -86,7 +85,6 @@ void MinimizeAllScriptTest::init()
AbstractScript *script = Scripting::self()->findScript(s_scriptName);
QVERIFY(script);
QSignalSpy runningChangedSpy(script, &AbstractScript::runningChanged);
QVERIFY(runningChangedSpy.isValid());
script->run();
QTRY_COMPARE(runningChangedSpy.count(), 1);
}

View file

@ -49,7 +49,6 @@ private:
void ScreenEdgeTest::initTestCase()
{
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -137,14 +136,12 @@ void ScreenEdgeTest::testEdge()
auto s = Scripting::self()->findScript(scriptToLoad);
QVERIFY(s);
QSignalSpy runningChangedSpy(s, &AbstractScript::runningChanged);
QVERIFY(runningChangedSpy.isValid());
s->run();
QVERIFY(runningChangedSpy.wait());
QCOMPARE(runningChangedSpy.count(), 1);
QCOMPARE(runningChangedSpy.first().first().toBool(), true);
// triggering the edge will result in show desktop being triggered
QSignalSpy showDesktopSpy(workspace(), &Workspace::showingDesktopChanged);
QVERIFY(showDesktopSpy.isValid());
// trigger the edge
QFETCH(QPoint, triggerPos);
@ -186,14 +183,12 @@ void ScreenEdgeTest::testTouchEdge()
auto s = Scripting::self()->findScript(scriptToLoad);
QVERIFY(s);
QSignalSpy runningChangedSpy(s, &AbstractScript::runningChanged);
QVERIFY(runningChangedSpy.isValid());
s->run();
QVERIFY(runningChangedSpy.wait());
QCOMPARE(runningChangedSpy.count(), 1);
QCOMPARE(runningChangedSpy.first().first().toBool(), true);
// triggering the edge will result in show desktop being triggered
QSignalSpy showDesktopSpy(workspace(), &Workspace::showingDesktopChanged);
QVERIFY(showDesktopSpy.isValid());
// trigger the edge
QFETCH(QPoint, triggerPos);
@ -229,7 +224,6 @@ void ScreenEdgeTest::testEdgeUnregister()
QVERIFY(runningChangedSpy.wait());
QSignalSpy showDesktopSpy(workspace(), &Workspace::showingDesktopChanged);
QVERIFY(showDesktopSpy.isValid());
// trigger the edge
KWin::Cursors::self()->mouse()->setPos(triggerPos);
@ -272,7 +266,6 @@ void ScreenEdgeTest::testDeclarativeTouchEdge()
QTRY_COMPARE(runningChangedSpy.count(), 1);
QSignalSpy showDesktopSpy(workspace(), &Workspace::showingDesktopChanged);
QVERIFY(showDesktopSpy.isValid());
// Trigger the edge through touch
quint32 timestamp = 0;

View file

@ -39,7 +39,6 @@ void ShadeTest::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));
@ -91,7 +90,6 @@ void ShadeTest::testShadeGeometry()
// 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);
@ -120,7 +118,6 @@ void ShadeTest::testShadeGeometry()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}

View file

@ -37,7 +37,6 @@ void ShowingDesktopTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));

View file

@ -56,7 +56,6 @@ void StackingOrderTest::initTestCase()
qRegisterMetaType<KWin::Deleted *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -250,7 +249,6 @@ void StackingOrderTest::testDeletedTransient()
});
QSignalSpy windowClosedSpy(transient2, &Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
delete transient2ShellSurface;
transient2Surface.reset();
QVERIFY(windowClosedSpy.wait());
@ -328,7 +326,6 @@ void StackingOrderTest::testGroupTransientIsAboveWindowGroup()
xcb_connect(nullptr, nullptr));
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
// Create the group leader.
xcb_window_t leaderWid = createGroupWindow(conn.get(), geometry);
@ -442,7 +439,6 @@ void StackingOrderTest::testRaiseGroupTransient()
xcb_connect(nullptr, nullptr));
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
// Create the group leader.
xcb_window_t leaderWid = createGroupWindow(conn.get(), geometry);
@ -574,7 +570,6 @@ void StackingOrderTest::testDeletedGroupTransient()
xcb_connect(nullptr, nullptr));
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
// Create the group leader.
xcb_window_t leaderWid = createGroupWindow(conn.get(), geometry);
@ -669,7 +664,6 @@ void StackingOrderTest::testDeletedGroupTransient()
});
QSignalSpy windowClosedSpy(transient, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(conn.get(), transientWid);
xcb_flush(conn.get());
QVERIFY(windowClosedSpy.wait());
@ -692,7 +686,6 @@ void StackingOrderTest::testDontKeepAboveNonModalDialogGroupTransients()
xcb_connect(nullptr, nullptr));
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
// Create the group leader.
xcb_window_t leaderWid = createGroupWindow(conn.get(), geometry);

View file

@ -60,7 +60,6 @@ void StrutsTest::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));
@ -171,7 +170,6 @@ void StrutsTest::testWaylandStruts()
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(configureRequestedSpy.wait());
@ -213,7 +211,6 @@ void StrutsTest::testWaylandStruts()
for (auto it = windows.begin(); it != windows.end();) {
auto &[window, surface] = *it;
QSignalSpy destroyedSpy(window, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
it = windows.erase(it);
QVERIFY(destroyedSpy.wait());
}
@ -235,7 +232,6 @@ void StrutsTest::testMoveWaylandPanel()
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(configureRequestedSpy.wait());
@ -254,7 +250,6 @@ void StrutsTest::testMoveWaylandPanel()
QCOMPARE(workspace()->clientArea(WorkArea, outputs[0], desktop), QRect(0, 0, 2560, 1000));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
plasmaSurface->setPosition(QPoint(1280, 1000));
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(window->frameGeometry(), QRect(1280, 1000, 1280, 24));
@ -287,7 +282,6 @@ void StrutsTest::testWaylandMobilePanel()
plasmaSurface->setRole(PlasmaShellSurface::Role::Panel);
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(configureRequestedSpy.wait());
@ -315,7 +309,6 @@ void StrutsTest::testWaylandMobilePanel()
plasmaSurface2->setRole(PlasmaShellSurface::Role::Panel);
QSignalSpy configureRequestedSpy2(shellSurface2->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(configureRequestedSpy2.isValid());
surface2->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(configureRequestedSpy2.wait());
@ -622,7 +615,6 @@ void StrutsTest::testX11Struts()
// 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);
@ -661,7 +653,6 @@ void StrutsTest::testX11Struts()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
// now struts should be removed again
@ -739,7 +730,6 @@ void StrutsTest::test363804()
// 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);
@ -762,7 +752,6 @@ void StrutsTest::test363804()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
@ -824,7 +813,6 @@ void StrutsTest::testLeftScreenSmallerBottomAligned()
// 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);
@ -865,7 +853,6 @@ void StrutsTest::testLeftScreenSmallerBottomAligned()
QCOMPARE(window2->maximizeMode(), KWin::MaximizeFull);
// destroy window again
QSignalSpy normalWindowClosedSpy(window2, &X11Window::windowClosed);
QVERIFY(normalWindowClosedSpy.isValid());
xcb_unmap_window(c.get(), w2);
xcb_destroy_window(c.get(), w2);
xcb_flush(c.get());
@ -878,7 +865,6 @@ void StrutsTest::testLeftScreenSmallerBottomAligned()
c.reset();
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
}
@ -941,7 +927,6 @@ void StrutsTest::testWindowMoveWithPanelBetweenScreens()
// 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);

View file

@ -43,7 +43,6 @@ void TabBoxTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -93,9 +92,7 @@ void TabBoxTest::testCapsLock()
// Setup tabbox signal spies
QSignalSpy tabboxAddedSpy(workspace()->tabbox(), &TabBox::TabBox::tabBoxAdded);
QVERIFY(tabboxAddedSpy.isValid());
QSignalSpy tabboxClosedSpy(workspace()->tabbox(), &TabBox::TabBox::tabBoxClosed);
QVERIFY(tabboxClosedSpy.isValid());
// enable capslock
quint32 timestamp = 0;
@ -156,9 +153,7 @@ void TabBoxTest::testMoveForward()
// Setup tabbox signal spies
QSignalSpy tabboxAddedSpy(workspace()->tabbox(), &TabBox::TabBox::tabBoxAdded);
QVERIFY(tabboxAddedSpy.isValid());
QSignalSpy tabboxClosedSpy(workspace()->tabbox(), &TabBox::TabBox::tabBoxClosed);
QVERIFY(tabboxClosedSpy.isValid());
// press alt+tab
quint32 timestamp = 0;
@ -207,9 +202,7 @@ void TabBoxTest::testMoveBackward()
// Setup tabbox signal spies
QSignalSpy tabboxAddedSpy(workspace()->tabbox(), &TabBox::TabBox::tabBoxAdded);
QVERIFY(tabboxAddedSpy.isValid());
QSignalSpy tabboxClosedSpy(workspace()->tabbox(), &TabBox::TabBox::tabBoxClosed);
QVERIFY(tabboxClosedSpy.isValid());
// press alt+shift+tab
quint32 timestamp = 0;

View file

@ -807,7 +807,6 @@ QtWayland::zwp_input_panel_surface_v1 *createInputPanelSurfaceV1(KWayland::Clien
static void waitForConfigured(XdgSurface *shellSurface)
{
QSignalSpy surfaceConfigureRequestedSpy(shellSurface, &XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
shellSurface->surface()->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(surfaceConfigureRequestedSpy.wait());

View file

@ -44,7 +44,6 @@ void VirtualKeyboardDBusTest::initTestCase()
{
QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kwin.testvirtualkeyboard"));
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));
@ -71,12 +70,10 @@ void VirtualKeyboardDBusTest::testEnabled()
VirtualKeyboardDBus dbus(KWin::kwinApp()->inputMethod());
OrgKdeKwinVirtualKeyboardInterface iface(QStringLiteral("org.kde.kwin.testvirtualkeyboard"), QStringLiteral("/VirtualKeyboard"), QDBusConnection::sessionBus());
QSignalSpy helperChangedSpy(&iface, &OrgKdeKwinVirtualKeyboardInterface::enabledChanged);
QVERIFY(helperChangedSpy.isValid());
QCOMPARE(dbus.isEnabled(), false);
QCOMPARE(dbus.property("enabled").toBool(), false);
QSignalSpy enabledChangedSpy(&dbus, &VirtualKeyboardDBus::enabledChanged);
QVERIFY(enabledChangedSpy.isValid());
QVERIFY(iface.isValid());
QCOMPARE(iface.enabled(), false);

View file

@ -52,7 +52,6 @@ void TouchInputTest::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));
@ -160,15 +159,10 @@ void TouchInputTest::testMultipleTouchPoints()
window->move(QPoint(100, 100));
QVERIFY(window);
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
QVERIFY(sequenceStartedSpy.isValid());
QSignalSpy pointAddedSpy(m_touch, &Touch::pointAdded);
QVERIFY(pointAddedSpy.isValid());
QSignalSpy pointMovedSpy(m_touch, &Touch::pointMoved);
QVERIFY(pointMovedSpy.isValid());
QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved);
QVERIFY(pointRemovedSpy.isValid());
QSignalSpy endedSpy(m_touch, &Touch::sequenceEnded);
QVERIFY(endedSpy.isValid());
quint32 timestamp = 1;
Test::touchDown(1, QPointF(125, 125) + window->clientPos(), timestamp++);
@ -220,11 +214,8 @@ void TouchInputTest::testCancel()
window->move(QPoint(100, 100));
QVERIFY(window);
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
QVERIFY(sequenceStartedSpy.isValid());
QSignalSpy cancelSpy(m_touch, &Touch::sequenceCanceled);
QVERIFY(cancelSpy.isValid());
QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved);
QVERIFY(pointRemovedSpy.isValid());
quint32 timestamp = 1;
Test::touchDown(1, QPointF(125, 125), timestamp++);
@ -252,7 +243,6 @@ void TouchInputTest::testTouchMouseAction()
// also create a sequence started spy as the touch event should be passed through
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
QVERIFY(sequenceStartedSpy.isValid());
quint32 timestamp = 1;
Test::touchDown(1, c1->frameGeometry().center(), timestamp++);
@ -287,7 +277,6 @@ void TouchInputTest::testUpdateFocusOnDecorationDestroy()
// if decoration was focused and then destroyed on maximize with BorderlessMaximizedWindows option.
QSignalSpy sequenceEndedSpy(m_touch, &KWayland::Client::Touch::sequenceEnded);
QVERIFY(sequenceEndedSpy.isValid());
// Enable the borderless maximized windows option.
auto group = kwinApp()->config()->group("Windows");
@ -347,7 +336,6 @@ void TouchInputTest::testUpdateFocusOnDecorationDestroy()
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
@ -392,7 +380,6 @@ void TouchInputTest::testGestureDetection()
// verify that gestures are canceled properly
QSignalSpy gestureCancelled(&action, &QAction::triggered);
QVERIFY(gestureCancelled.isValid());
Test::touchUp(0, timestamp++);
QVERIFY(gestureCancelled.wait());

View file

@ -62,7 +62,6 @@ void TransientPlacementTest::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));
@ -527,7 +526,6 @@ void TransientPlacementTest::testXdgPopupWithPanel()
QVERIFY(surfaceConfigureRequestedSpy.wait());
parentShellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
QSignalSpy frameGeometryChangedSpy{parent, &Window::frameGeometryChanged};
QVERIFY(frameGeometryChangedSpy.isValid());
Test::render(parentSurface.get(), toplevelConfigureRequestedSpy.last().at(0).toSize(), Qt::red);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(parent->frameGeometry(), output->geometry());

View file

@ -40,7 +40,6 @@ void VirtualDesktopTest::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
@ -134,7 +133,6 @@ void VirtualDesktopTest::testLastDesktopRemoved()
QVERIFY(window);
QCOMPARE(window->desktop(), 2);
QSignalSpy desktopPresenceChangedSpy(window, &Window::desktopPresenceChanged);
QVERIFY(desktopPresenceChangedSpy.isValid());
QCOMPARE(window->desktops().count(), 1u);
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), window->desktops().first());
@ -169,7 +167,6 @@ void VirtualDesktopTest::testWindowOnMultipleDesktops()
QVERIFY(window);
QCOMPARE(window->desktop(), 3u);
QSignalSpy desktopPresenceChangedSpy(window, &Window::desktopPresenceChanged);
QVERIFY(desktopPresenceChangedSpy.isValid());
QCOMPARE(window->desktops().count(), 1u);
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), window->desktops().first());
@ -248,7 +245,6 @@ void VirtualDesktopTest::testRemoveDesktopWithWindow()
QVERIFY(window);
QCOMPARE(window->desktop(), 3u);
QSignalSpy desktopPresenceChangedSpy(window, &Window::desktopPresenceChanged);
QVERIFY(desktopPresenceChangedSpy.isValid());
QCOMPARE(window->desktops().count(), 1u);
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), window->desktops().first());

View file

@ -43,7 +43,6 @@ void WindowRuleTest::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));
@ -125,7 +124,6 @@ void WindowRuleTest::testApplyInitialMaximizeVert()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -140,7 +138,6 @@ void WindowRuleTest::testApplyInitialMaximizeVert()
// destroy window again
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -190,7 +187,6 @@ void WindowRuleTest::testWindowClassChange()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -205,7 +201,6 @@ void WindowRuleTest::testWindowClassChange()
// now change class
QSignalSpy windowClassChangedSpy{window, &X11Window::windowClassChanged};
QVERIFY(windowClassChangedSpy.isValid());
xcb_icccm_set_wm_class(c.get(), windowId, 23, "org.kde.foo\0org.kde.foo");
xcb_flush(c.get());
QVERIFY(windowClassChangedSpy.wait());
@ -213,7 +208,6 @@ void WindowRuleTest::testWindowClassChange()
// destroy window
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());

View file

@ -55,7 +55,6 @@ void TestWindowSelection::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));
@ -91,13 +90,9 @@ void TestWindowSelection::testSelectOnWindowPointer()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(keyboardEnteredSpy.isValid());
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(keyboardLeftSpy.isValid());
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(window);
@ -177,13 +172,9 @@ void TestWindowSelection::testSelectOnWindowKeyboard()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(keyboardEnteredSpy.isValid());
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(keyboardLeftSpy.isValid());
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(window);
@ -246,9 +237,7 @@ void TestWindowSelection::testSelectOnWindowTouch()
// this test verifies window selection through touch
std::unique_ptr<Touch> touch(Test::waylandSeat()->createTouch());
QSignalSpy touchStartedSpy(touch.get(), &Touch::sequenceStarted);
QVERIFY(touchStartedSpy.isValid());
QSignalSpy touchCanceledSpy(touch.get(), &Touch::sequenceCanceled);
QVERIFY(touchCanceledSpy.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
@ -312,13 +301,9 @@ void TestWindowSelection::testCancelOnWindowPointer()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(keyboardEnteredSpy.isValid());
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(keyboardLeftSpy.isValid());
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(window);
@ -371,13 +356,9 @@ void TestWindowSelection::testCancelOnWindowKeyboard()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(keyboardEnteredSpy.isValid());
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(keyboardLeftSpy.isValid());
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(window);
@ -430,13 +411,9 @@ void TestWindowSelection::testSelectPointPointer()
std::unique_ptr<Pointer> pointer(Test::waylandSeat()->createPointer());
std::unique_ptr<Keyboard> keyboard(Test::waylandSeat()->createKeyboard());
QSignalSpy pointerEnteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(pointer.get(), &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy keyboardEnteredSpy(keyboard.get(), &Keyboard::entered);
QVERIFY(keyboardEnteredSpy.isValid());
QSignalSpy keyboardLeftSpy(keyboard.get(), &Keyboard::left);
QVERIFY(keyboardLeftSpy.isValid());
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(window);

View file

@ -66,7 +66,6 @@ void X11WindowTest::initTestCase()
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::Window *>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
QVERIFY(waylandServer()->init(s_socketName));
kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig));
@ -122,7 +121,6 @@ void X11WindowTest::testMinimumSize()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -195,7 +193,6 @@ void X11WindowTest::testMinimumSize()
// Destroy the window.
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -230,7 +227,6 @@ void X11WindowTest::testMaximumSize()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -302,7 +298,6 @@ void X11WindowTest::testMaximumSize()
// Destroy the window.
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -338,7 +333,6 @@ void X11WindowTest::testResizeIncrements()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -389,7 +383,6 @@ void X11WindowTest::testResizeIncrements()
// Destroy the window.
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -424,7 +417,6 @@ void X11WindowTest::testResizeIncrementsNoBaseSize()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -475,7 +467,6 @@ void X11WindowTest::testResizeIncrementsNoBaseSize()
// Destroy the window.
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -531,7 +522,6 @@ void X11WindowTest::testTrimCaption()
// 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);
@ -544,7 +534,6 @@ void X11WindowTest::testTrimCaption()
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
xcb_destroy_window(c.get(), windowId);
c.reset();
@ -580,7 +569,6 @@ void X11WindowTest::testFullscreenLayerWithActiveWaylandWindow()
// 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);
@ -700,7 +688,6 @@ void X11WindowTest::testFocusInWithWaylandLastActiveWindow()
// 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);
@ -760,7 +747,6 @@ void X11WindowTest::testX11WindowId()
// 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);
@ -803,7 +789,6 @@ void X11WindowTest::testX11WindowId()
xcb_unmap_window(c.get(), windowId);
xcb_flush(c.get());
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
QVERIFY(windowClosedSpy.wait());
QCOMPARE(deletedUuid.isNull(), false);
@ -839,7 +824,6 @@ void X11WindowTest::testCaptionChanges()
// 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);
@ -847,7 +831,6 @@ void X11WindowTest::testCaptionChanges()
QCOMPARE(window->caption(), QStringLiteral("foo"));
QSignalSpy captionChangedSpy(window, &X11Window::captionChanged);
QVERIFY(captionChangedSpy.isValid());
info.setName("bar");
xcb_flush(c.get());
QVERIFY(captionChangedSpy.wait());
@ -855,7 +838,6 @@ void X11WindowTest::testCaptionChanges()
// and destroy the window again
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_flush(c.get());
QVERIFY(windowClosedSpy.wait());
@ -872,7 +854,6 @@ void X11WindowTest::testCaptionWmName()
// open glxgears as that one only uses WM_NAME
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
QProcess glxgears;
glxgears.setProgram(QStringLiteral("glxgears"));
@ -917,7 +898,6 @@ void X11WindowTest::testCaptionMultipleWindows()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
@ -950,7 +930,6 @@ void X11WindowTest::testCaptionMultipleWindows()
QCOMPARE(QByteArray(info3.visibleIconName()), QByteArrayLiteral("foo <2>\u200E"));
QSignalSpy captionChangedSpy(window2, &X11Window::captionChanged);
QVERIFY(captionChangedSpy.isValid());
NETWinInfo info4(c.get(), w2, kwinApp()->x11RootWindow(), NET::Properties(), NET::Properties2());
info4.setName("foobar");
@ -994,7 +973,6 @@ void X11WindowTest::testFullscreenWindowGroups()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);
@ -1055,7 +1033,6 @@ void X11WindowTest::testActivateFocusedWindow()
QVERIFY(!xcb_connection_has_error(connection.get()));
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
const QRect windowGeometry(0, 0, 100, 200);
xcb_size_hints_t hints;
@ -1140,7 +1117,6 @@ void X11WindowTest::testReentrantMoveResize()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.first().first().value<X11Window *>();
QVERIFY(window);

View file

@ -179,7 +179,6 @@ void TestXdgShellWindowRules::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));
@ -321,11 +320,8 @@ void TestXdgShellWindowRules::testPositionApply()
// One should still be able to move the window around.
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(m_window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(m_window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
@ -373,11 +369,8 @@ void TestXdgShellWindowRules::testPositionRemember()
// One should still be able to move the window around.
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(m_window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(m_window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
@ -426,7 +419,6 @@ void TestXdgShellWindowRules::testPositionForce()
// User should not be able to move the window.
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
QVERIFY(!m_window->isInteractiveResize());
@ -458,7 +450,6 @@ void TestXdgShellWindowRules::testPositionApplyNow()
QCOMPARE(m_window->pos(), QPoint(0, 0));
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
setWindowRule("position", QPoint(42, 42), int(Rules::ApplyNow));
@ -470,11 +461,8 @@ void TestXdgShellWindowRules::testPositionApplyNow()
QVERIFY(m_window->isMovable());
QVERIFY(m_window->isMovableAcrossScreens());
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(m_window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(m_window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
@ -519,7 +507,6 @@ void TestXdgShellWindowRules::testPositionForceTemporarily()
// User should not be able to move the window.
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
QVERIFY(!m_window->isInteractiveResize());
@ -594,13 +581,9 @@ void TestXdgShellWindowRules::testSizeApply()
// One still should be able to resize the window.
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(m_window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(m_window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
@ -695,13 +678,9 @@ void TestXdgShellWindowRules::testSizeRemember()
// One should still be able to resize the window.
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(m_window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(m_window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
@ -789,7 +768,6 @@ void TestXdgShellWindowRules::testSizeForce()
// Any attempt to resize the window should not succeed.
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
QVERIFY(!m_window->isInteractiveResize());
@ -848,7 +826,6 @@ void TestXdgShellWindowRules::testSizeApplyNow()
// Draw the surface with the new size.
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
Test::render(m_surface.get(), QSize(480, 640), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
@ -885,7 +862,6 @@ void TestXdgShellWindowRules::testSizeForceTemporarily()
// Any attempt to resize the window should not succeed.
QSignalSpy clientStartMoveResizedSpy(m_window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
QVERIFY(!m_window->isInteractiveMove());
QVERIFY(!m_window->isInteractiveResize());
@ -993,7 +969,6 @@ void TestXdgShellWindowRules::testMaximizeApply()
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1071,7 +1046,6 @@ void TestXdgShellWindowRules::testMaximizeRemember()
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1218,7 +1192,6 @@ void TestXdgShellWindowRules::testMaximizeApplyNow()
// Draw contents of the maximized client.
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
Test::render(m_surface.get(), QSize(1280, 1024), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
@ -2291,7 +2264,6 @@ void TestXdgShellWindowRules::testShortcutDontAffect()
// If we press the window shortcut, nothing should happen.
QSignalSpy clientUnminimizedSpy(m_window, &Window::clientUnminimized);
QVERIFY(clientUnminimizedSpy.isValid());
quint32 timestamp = 1;
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
@ -2313,7 +2285,6 @@ void TestXdgShellWindowRules::testShortcutApply()
// If we press the window shortcut, the window should be brought back to user.
QSignalSpy clientUnminimizedSpy(m_window, &Window::clientUnminimized);
QVERIFY(clientUnminimizedSpy.isValid());
quint32 timestamp = 1;
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
m_window->minimize();
@ -2373,7 +2344,6 @@ void TestXdgShellWindowRules::testShortcutRemember()
// If we press the window shortcut, the window should be brought back to user.
QSignalSpy clientUnminimizedSpy(m_window, &Window::clientUnminimized);
QVERIFY(clientUnminimizedSpy.isValid());
quint32 timestamp = 1;
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
m_window->minimize();
@ -2421,7 +2391,6 @@ void TestXdgShellWindowRules::testShortcutForce()
// If we press the window shortcut, the window should be brought back to user.
QSignalSpy clientUnminimizedSpy(m_window, &Window::clientUnminimized);
QVERIFY(clientUnminimizedSpy.isValid());
quint32 timestamp = 1;
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
m_window->minimize();
@ -2469,7 +2438,6 @@ void TestXdgShellWindowRules::testShortcutApplyNow()
// The window should now have a window shortcut assigned.
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
QSignalSpy clientUnminimizedSpy(m_window, &Window::clientUnminimized);
QVERIFY(clientUnminimizedSpy.isValid());
quint32 timestamp = 1;
m_window->minimize();
QVERIFY(m_window->isMinimized());
@ -2513,7 +2481,6 @@ void TestXdgShellWindowRules::testShortcutForceTemporarily()
// If we press the window shortcut, the window should be brought back to user.
QSignalSpy clientUnminimizedSpy(m_window, &Window::clientUnminimized);
QVERIFY(clientUnminimizedSpy.isValid());
quint32 timestamp = 1;
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
m_window->minimize();
@ -2993,7 +2960,6 @@ void TestXdgShellWindowRules::testMatchAfterNameChange()
QCOMPARE(window->keepAbove(), false);
QSignalSpy desktopFileNameSpy(window, &Window::desktopFileNameChanged);
QVERIFY(desktopFileNameSpy.isValid());
shellSurface->set_app_id(QStringLiteral("org.kde.foo"));
QVERIFY(desktopFileNameSpy.wait());

View file

@ -126,8 +126,6 @@ void TestXdgShellWindow::testXdgWindowReactive()
QVERIFY(childWindow);
QSignalSpy popupConfigureRequested(popup.get(), &Test::XdgPopup::configureRequested);
QVERIFY(popupConfigureRequested.isValid());
rootWindow->move(rootWindow->pos() + QPoint(20, 20));
QVERIFY(popupConfigureRequested.wait());
@ -155,7 +153,6 @@ void TestXdgShellWindow::testXdgWindowRepositioning()
QVERIFY(childWindow);
QSignalSpy reconfigureSpy(popup.get(), &Test::XdgPopup::configureRequested);
QVERIFY(reconfigureSpy.isValid());
popup->reposition(otherPositioner->object(), 500000);
@ -170,7 +167,6 @@ void TestXdgShellWindow::initTestCase()
qRegisterMetaType<KWayland::Client::Output *>();
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));
@ -208,10 +204,8 @@ void TestXdgShellWindow::testMapUnmap()
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get(), Test::CreationSetup::CreateOnly));
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
QSignalSpy configureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(configureRequestedSpy.isValid());
// Tell the compositor that we want to map the surface.
surface->commit(KWayland::Client::Surface::CommitFlag::None);
@ -271,11 +265,8 @@ void TestXdgShellWindow::testDesktopPresenceChanged()
QCOMPARE(window->desktop(), 1);
effects->setNumberOfDesktops(4);
QSignalSpy desktopPresenceChangedClientSpy(window, &Window::desktopPresenceChanged);
QVERIFY(desktopPresenceChangedClientSpy.isValid());
QSignalSpy desktopPresenceChangedWorkspaceSpy(workspace(), &Workspace::desktopPresenceChanged);
QVERIFY(desktopPresenceChangedWorkspaceSpy.isValid());
QSignalSpy desktopPresenceChangedEffectsSpy(effects, &EffectsHandler::desktopPresenceChanged);
QVERIFY(desktopPresenceChangedEffectsSpy.isValid());
// let's change the desktop
workspace()->sendWindowToDesktop(window, 2, false);
@ -396,9 +387,7 @@ void TestXdgShellWindow::testFullscreen()
QCOMPARE(window->clientSizeToFrameSize(window->clientSize()), window->size());
QSignalSpy fullScreenChangedSpy(window, &Window::fullScreenChanged);
QVERIFY(fullScreenChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
// Wait for the compositor to send a configure event with the Activated state.
QVERIFY(surfaceConfigureRequestedSpy.wait());
@ -483,7 +472,6 @@ void TestXdgShellWindow::testSendFullScreenWindowToAnotherOutput()
// Make the window fullscreen.
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->set_fullscreen(nullptr);
QVERIFY(surfaceConfigureRequestedSpy.wait());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
@ -538,9 +526,7 @@ void TestXdgShellWindow::testMaximizedToFullscreen()
QCOMPARE(window->isDecorated(), decoMode == Test::XdgToplevelDecorationV1::mode_server_side);
QSignalSpy fullscreenChangedSpy(window, &Window::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
// Wait for the compositor to send a configure event with the Activated state.
QVERIFY(surfaceConfigureRequestedSpy.wait());
@ -622,9 +608,7 @@ void TestXdgShellWindow::testFullscreenMultipleOutputs()
QVERIFY(!window->isDecorated());
QSignalSpy fullscreenChangedSpy(window, &Window::fullScreenChanged);
QVERIFY(fullscreenChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
@ -699,9 +683,7 @@ void TestXdgShellWindow::testDesktopFileName()
QCOMPARE(window->icon().name(), QStringLiteral("wayland"));
QSignalSpy desktopFileNameChangedSpy(window, &Window::desktopFileNameChanged);
QVERIFY(desktopFileNameChangedSpy.isValid());
QSignalSpy iconChangedSpy(window, &Window::iconChanged);
QVERIFY(iconChangedSpy.isValid());
shellSurface->set_app_id(QStringLiteral("org.kde.bar"));
QVERIFY(desktopFileNameChangedSpy.wait());
QCOMPARE(window->desktopFileName(), QByteArrayLiteral("org.kde.bar"));
@ -772,7 +754,6 @@ void TestXdgShellWindow::testCaptionMultipleWindows()
QCOMPARE(c4->captionNormal(), QStringLiteral("bar"));
QCOMPARE(c4->captionSuffix(), QString());
QSignalSpy captionChangedSpy(c4, &Window::captionChanged);
QVERIFY(captionChangedSpy.isValid());
shellSurface4->set_title(QStringLiteral("foo"));
QVERIFY(captionChangedSpy.wait());
QCOMPARE(captionChangedSpy.count(), 1);
@ -797,7 +778,6 @@ void TestXdgShellWindow::testUnresponsiveWindow()
const QString kill = QFINDTESTDATA(QStringLiteral("kill"));
QVERIFY(!kill.isEmpty());
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
std::unique_ptr<QProcess> process(new QProcess);
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
@ -820,7 +800,6 @@ void TestXdgShellWindow::testUnresponsiveWindow()
process->setProcessChannelMode(QProcess::ForwardedChannels);
process->setProgram(kill);
QSignalSpy processStartedSpy{process.get(), &QProcess::started};
QVERIFY(processStartedSpy.isValid());
process->start();
QVERIFY(processStartedSpy.wait());
@ -1129,7 +1108,6 @@ void TestXdgShellWindow::testXdgWindowGeometryIsntSet()
const QPointF oldPosition = window->pos();
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
Test::render(surface.get(), QSize(100, 50), Qt::blue);
QVERIFY(frameGeometryChangedSpy.wait());
QCOMPARE(window->frameGeometry().topLeft(), oldPosition);
@ -1167,7 +1145,6 @@ void TestXdgShellWindow::testXdgWindowGeometryAttachBuffer()
const QPointF oldPosition = window->pos();
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->set_window_geometry(10, 10, 180, 80);
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1214,7 +1191,6 @@ void TestXdgShellWindow::testXdgWindowGeometryAttachSubSurface()
const QPointF oldPosition = window->pos();
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->set_window_geometry(10, 10, 180, 80);
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1258,12 +1234,10 @@ void TestXdgShellWindow::testXdgWindowGeometryInteractiveResize()
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->set_window_geometry(10, 10, 180, 80);
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1271,11 +1245,8 @@ void TestXdgShellWindow::testXdgWindowGeometryInteractiveResize()
QCOMPARE(window->frameGeometry().size(), QSize(180, 80));
QSignalSpy clientStartMoveResizedSpy(window, &Window::clientStartUserMovedResized);
QVERIFY(clientStartMoveResizedSpy.isValid());
QSignalSpy clientStepUserMovedResizedSpy(window, &Window::clientStepUserMovedResized);
QVERIFY(clientStepUserMovedResizedSpy.isValid());
QSignalSpy clientFinishUserMovedResizedSpy(window, &Window::clientFinishUserMovedResized);
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
// Start interactively resizing the window.
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
@ -1351,12 +1322,10 @@ void TestXdgShellWindow::testXdgWindowGeometryFullScreen()
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->set_window_geometry(10, 10, 180, 80);
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1408,12 +1377,10 @@ void TestXdgShellWindow::testXdgWindowGeometryMaximize()
QSignalSpy toplevelConfigureRequestedSpy(shellSurface.get(), &Test::XdgToplevel::configureRequested);
QSignalSpy surfaceConfigureRequestedSpy(shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested);
QVERIFY(surfaceConfigureRequestedSpy.isValid());
QVERIFY(surfaceConfigureRequestedSpy.wait());
QCOMPARE(surfaceConfigureRequestedSpy.count(), 1);
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->set_window_geometry(10, 10, 180, 80);
surface->commit(KWayland::Client::Surface::CommitFlag::None);
QVERIFY(frameGeometryChangedSpy.wait());
@ -1461,9 +1428,7 @@ void TestXdgShellWindow::testPointerInputTransform()
QVERIFY(pointer);
QVERIFY(pointer->isValid());
QSignalSpy pointerEnteredSpy(pointer.get(), &KWayland::Client::Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerMotionSpy(pointer.get(), &KWayland::Client::Pointer::motion);
QVERIFY(pointerMotionSpy.isValid());
// Create an xdg_toplevel surface and wait for the compositor to catch up.
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
@ -1488,9 +1453,7 @@ void TestXdgShellWindow::testPointerInputTransform()
// Let's pretend that the window has changed the extents of the client-side drop-shadow
// but the frame geometry didn't change.
QSignalSpy bufferGeometryChangedSpy(window, &Window::bufferGeometryChanged);
QVERIFY(bufferGeometryChangedSpy.isValid());
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->xdgSurface()->set_window_geometry(10, 20, 200, 100);
Test::render(surface.get(), QSize(220, 140), Qt::blue);
QVERIFY(bufferGeometryChangedSpy.wait());
@ -1653,7 +1616,6 @@ void TestXdgShellWindow::testMaximizeHorizontal()
// Draw contents of the maximized window.
QSignalSpy geometryChangedSpy(window, &Window::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), QSize(1280, 600), Qt::blue);
QVERIFY(geometryChangedSpy.wait());
@ -1733,7 +1695,6 @@ void TestXdgShellWindow::testMaximizeVertical()
// Draw contents of the maximized window.
QSignalSpy geometryChangedSpy(window, &Window::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), QSize(800, 1024), Qt::blue);
QVERIFY(geometryChangedSpy.wait());
@ -1813,7 +1774,6 @@ void TestXdgShellWindow::testMaximizeFull()
// Draw contents of the maximized window.
QSignalSpy geometryChangedSpy(window, &Window::geometryChanged);
QVERIFY(geometryChangedSpy.isValid());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());
Test::render(surface.get(), QSize(1280, 1024), Qt::blue);
QVERIFY(geometryChangedSpy.wait());
@ -1870,7 +1830,6 @@ void TestXdgShellWindow::testSendMaximizedWindowToAnotherOutput()
// Make the window maximized.
QSignalSpy frameGeometryChangedSpy(window, &Window::frameGeometryChanged);
QVERIFY(frameGeometryChangedSpy.isValid());
shellSurface->set_maximized();
QVERIFY(surfaceConfigureRequestedSpy.wait());
shellSurface->xdgSurface()->ack_configure(surfaceConfigureRequestedSpy.last().at(0).value<quint32>());

View file

@ -42,7 +42,6 @@ void XWaylandInputTest::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));
@ -132,9 +131,7 @@ void XWaylandInputTest::testPointerEnterLeaveSsd()
}
X11EventReaderHelper eventReader(c.get());
QSignalSpy enteredSpy(&eventReader, &X11EventReaderHelper::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(&eventReader, &X11EventReaderHelper::left);
QVERIFY(leftSpy.isValid());
// atom for the screenedge show hide functionality
Xcb::Atom atom(QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"), false, c.get());
@ -159,7 +156,6 @@ void XWaylandInputTest::testPointerEnterLeaveSsd()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -187,7 +183,6 @@ void XWaylandInputTest::testPointerEnterLeaveSsd()
// destroy window again
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());
@ -210,9 +205,7 @@ void XWaylandInputTest::testPointerEventLeaveCsd()
X11EventReaderHelper eventReader(c.get());
QSignalSpy enteredSpy(&eventReader, &X11EventReaderHelper::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(&eventReader, &X11EventReaderHelper::left);
QVERIFY(leftSpy.isValid());
// Extents of the client-side drop-shadow.
NETStrut clientFrameExtent;
@ -248,7 +241,6 @@ void XWaylandInputTest::testPointerEventLeaveCsd()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -277,7 +269,6 @@ void XWaylandInputTest::testPointerEventLeaveCsd()
// Destroy the window.
QSignalSpy windowClosedSpy(window, &X11Window::windowClosed);
QVERIFY(windowClosedSpy.isValid());
xcb_unmap_window(c.get(), windowId);
xcb_destroy_window(c.get(), windowId);
xcb_flush(c.get());

View file

@ -50,7 +50,6 @@ void XwaylandSelectionsTest::initTestCase()
qRegisterMetaType<KWin::Window *>();
qRegisterMetaType<QProcess::ExitStatus>();
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
QVERIFY(applicationStartedSpy.isValid());
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
// QSignalSpy clipboardSyncDevicedCreated{waylandServer(), &WaylandServer::xclipboardSyncDataDeviceCreated};
// QVERIFY(clipboardSyncDevicedCreated.isValid());
@ -87,9 +86,7 @@ void XwaylandSelectionsTest::testSync()
QVERIFY(!paste.isEmpty());
QSignalSpy windowAddedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowAddedSpy.isValid());
QSignalSpy clipboardChangedSpy(waylandServer()->seat(), &KWaylandServer::SeatInterface::selectionChanged);
QVERIFY(clipboardChangedSpy.isValid());
QProcessEnvironment environment = QProcessEnvironment::systemEnvironment();
@ -117,7 +114,6 @@ void XwaylandSelectionsTest::testSync()
// start the paste process
std::unique_ptr<QProcess, ProcessKillBeforeDeleter> pasteProcess(new QProcess());
QSignalSpy finishedSpy(pasteProcess.get(), static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished));
QVERIFY(finishedSpy.isValid());
QFETCH(QString, pastePlatform);
environment.insert(QStringLiteral("QT_QPA_PLATFORM"), pastePlatform);
pasteProcess->setProcessEnvironment(environment);
@ -135,7 +131,6 @@ void XwaylandSelectionsTest::testSync()
if (workspace()->activeWindow() != pasteWindow) {
QSignalSpy windowActivatedSpy(workspace(), &Workspace::windowActivated);
QVERIFY(windowActivatedSpy.isValid());
workspace()->activateWindow(pasteWindow);
QVERIFY(windowActivatedSpy.wait());
}

View file

@ -47,7 +47,6 @@ void XwaylandServerCrashTest::initTestCase()
qRegisterMetaType<Unmanaged *>();
qRegisterMetaType<X11Window *>();
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));
@ -91,7 +90,6 @@ void XwaylandServerCrashTest::testCrash()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
QPointer<X11Window> window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);
@ -109,14 +107,12 @@ void XwaylandServerCrashTest::testCrash()
xcb_flush(c.get());
QSignalSpy unmanagedAddedSpy(workspace(), &Workspace::unmanagedAdded);
QVERIFY(unmanagedAddedSpy.isValid());
QVERIFY(unmanagedAddedSpy.wait());
QPointer<Unmanaged> unmanaged = unmanagedAddedSpy.last().first().value<Unmanaged *>();
QVERIFY(unmanaged);
// Let's pretend that the Xwayland process has crashed.
QSignalSpy x11ConnectionChangedSpy(kwinApp(), &Application::x11ConnectionChanged);
QVERIFY(x11ConnectionChangedSpy.isValid());
Xwl::Xwayland *xwayland = static_cast<Xwl::Xwayland *>(kwinApp()->xwayland());
xwayland->xwaylandLauncher()->process()->terminate();
QVERIFY(x11ConnectionChangedSpy.wait());

View file

@ -43,7 +43,6 @@ private Q_SLOTS:
void XwaylandServerRestartTest::initTestCase()
{
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));
@ -72,7 +71,6 @@ void XwaylandServerRestartTest::testRestart()
// Pretend that the Xwayland process has crashed by sending a SIGKILL to it.
QSignalSpy startedSpy(xwayland, &Xwl::Xwayland::started);
QVERIFY(startedSpy.isValid());
kwin_safe_kill(xwayland->xwaylandLauncher()->process());
QVERIFY(startedSpy.wait());
QCOMPARE(startedSpy.count(), 1);
@ -95,7 +93,6 @@ void XwaylandServerRestartTest::testRestart()
xcb_flush(c.get());
QSignalSpy windowCreatedSpy(workspace(), &Workspace::windowAdded);
QVERIFY(windowCreatedSpy.isValid());
QVERIFY(windowCreatedSpy.wait());
X11Window *window = windowCreatedSpy.last().first().value<X11Window *>();
QVERIFY(window);

View file

@ -872,7 +872,6 @@ void TestLibinputDevice::testPointerAcceleration()
QCOMPARE(dbusProperty<qreal>(d.sysName(), "pointerAcceleration"), accel);
QSignalSpy pointerAccelChangedSpy(&d, &Device::pointerAccelerationChanged);
QVERIFY(pointerAccelChangedSpy.isValid());
QFETCH(qreal, setAccel);
d.setPointerAcceleration(setAccel);
QTEST(d.pointerAcceleration(), "expectedAccel");
@ -913,7 +912,6 @@ void TestLibinputDevice::testLeftHanded()
QCOMPARE(dbusProperty<bool>(d.sysName(), "leftHanded"), supported && initValue);
QSignalSpy leftHandedChangedSpy(&d, &Device::leftHandedChanged);
QVERIFY(leftHandedChangedSpy.isValid());
QFETCH(bool, setValue);
d.setLeftHanded(setValue);
QFETCH(bool, expectedValue);
@ -1051,7 +1049,6 @@ void TestLibinputDevice::testEnabled()
QCOMPARE(dbusProperty<bool>(d.sysName(), "enabled"), !supported || initValue);
QSignalSpy enabledChangedSpy(&d, &Device::enabledChanged);
QVERIFY(enabledChangedSpy.isValid());
QFETCH(bool, setValue);
d.setEnabled(setValue);
QFETCH(bool, expectedValue);
@ -1093,7 +1090,6 @@ void TestLibinputDevice::testTapToClick()
QCOMPARE(dbusProperty<bool>(d.sysName(), "tapToClick"), initValue);
QSignalSpy tapToClickChangedSpy(&d, &Device::tapToClickChanged);
QVERIFY(tapToClickChangedSpy.isValid());
QFETCH(bool, setValue);
d.setTapToClick(setValue);
QFETCH(bool, expectedValue);
@ -1150,7 +1146,6 @@ void TestLibinputDevice::testTapAndDrag()
QCOMPARE(dbusProperty<bool>(d.sysName(), "tapAndDrag"), initValue);
QSignalSpy tapAndDragChangedSpy(&d, &Device::tapAndDragChanged);
QVERIFY(tapAndDragChangedSpy.isValid());
QFETCH(bool, setValue);
d.setTapAndDrag(setValue);
QFETCH(bool, expectedValue);
@ -1207,7 +1202,6 @@ void TestLibinputDevice::testTapDragLock()
QCOMPARE(dbusProperty<bool>(d.sysName(), "tapDragLock"), initValue);
QSignalSpy tapDragLockChangedSpy(&d, &Device::tapDragLockChanged);
QVERIFY(tapDragLockChangedSpy.isValid());
QFETCH(bool, setValue);
d.setTapDragLock(setValue);
QFETCH(bool, expectedValue);
@ -1249,7 +1243,6 @@ void TestLibinputDevice::testMiddleEmulation()
QCOMPARE(dbusProperty<bool>(d.sysName(), "middleEmulation"), initValue);
QSignalSpy middleEmulationChangedSpy(&d, &Device::middleEmulationChanged);
QVERIFY(middleEmulationChangedSpy.isValid());
QFETCH(bool, setValue);
d.setMiddleEmulation(setValue);
QFETCH(bool, expectedValue);
@ -1292,7 +1285,6 @@ void TestLibinputDevice::testNaturalScroll()
QCOMPARE(dbusProperty<bool>(d.sysName(), "naturalScroll"), initValue);
QSignalSpy naturalScrollChangedSpy(&d, &Device::naturalScrollChanged);
QVERIFY(naturalScrollChangedSpy.isValid());
QFETCH(bool, setValue);
d.setNaturalScroll(setValue);
QFETCH(bool, expectedValue);
@ -1314,7 +1306,6 @@ void TestLibinputDevice::testScrollFactor()
QCOMPARE(dbusProperty<qreal>(d.sysName(), "scrollFactor"), initValue);
QSignalSpy scrollFactorChangedSpy(&d, &Device::scrollFactorChanged);
QVERIFY(scrollFactorChangedSpy.isValid());
qreal expectedValue = 2.0;
@ -1364,7 +1355,6 @@ void TestLibinputDevice::testScrollTwoFinger()
QCOMPARE(dbusProperty<bool>(d.sysName(), "scrollEdge"), otherValue);
QSignalSpy scrollMethodChangedSpy(&d, &Device::scrollMethodChanged);
QVERIFY(scrollMethodChangedSpy.isValid());
QFETCH(bool, setValue);
d.setScrollTwoFinger(setValue);
QFETCH(bool, expectedValue);
@ -1413,7 +1403,6 @@ void TestLibinputDevice::testScrollEdge()
QCOMPARE(dbusProperty<bool>(d.sysName(), "scrollTwoFinger"), otherValue);
QSignalSpy scrollMethodChangedSpy(&d, &Device::scrollMethodChanged);
QVERIFY(scrollMethodChangedSpy.isValid());
QFETCH(bool, setValue);
d.setScrollEdge(setValue);
QFETCH(bool, expectedValue);
@ -1462,7 +1451,6 @@ void TestLibinputDevice::testScrollButtonDown()
QCOMPARE(dbusProperty<bool>(d.sysName(), "scrollTwoFinger"), otherValue);
QSignalSpy scrollMethodChangedSpy(&d, &Device::scrollMethodChanged);
QVERIFY(scrollMethodChangedSpy.isValid());
QFETCH(bool, setValue);
d.setScrollOnButtonDown(setValue);
QFETCH(bool, expectedValue);
@ -1502,7 +1490,6 @@ void TestLibinputDevice::testScrollButton()
QCOMPARE(dbusProperty<quint32>(d.sysName(), "scrollButton"), initValue);
QSignalSpy scrollButtonChangedSpy(&d, &Device::scrollButtonChanged);
QVERIFY(scrollButtonChangedSpy.isValid());
QFETCH(quint32, setValue);
d.setScrollButton(setValue);
QFETCH(quint32, expectedValue);
@ -1593,7 +1580,6 @@ void TestLibinputDevice::testLmrTapButtonMap()
QCOMPARE(d.property("lmrTapButtonMap").toBool(), initValue);
QSignalSpy tapButtonMapChangedSpy(&d, &Device::tapButtonMapChanged);
QVERIFY(tapButtonMapChangedSpy.isValid());
QFETCH(bool, setValue);
d.setLmrTapButtonMap(setValue);
QFETCH(bool, expectedValue);
@ -1635,7 +1621,6 @@ void TestLibinputDevice::testDisableWhileTyping()
QCOMPARE(dbusProperty<bool>(d.sysName(), "disableWhileTyping"), initValue);
QSignalSpy disableWhileTypingChangedSpy(&d, &Device::disableWhileTypingChanged);
QVERIFY(disableWhileTypingChangedSpy.isValid());
QFETCH(bool, setValue);
d.setDisableWhileTyping(setValue);
QFETCH(bool, expectedValue);

View file

@ -97,7 +97,6 @@ void OnScreenNotificationTest::iconName()
{
OnScreenNotification notification;
QSignalSpy iconNameChangedSpy(&notification, &OnScreenNotification::iconNameChanged);
QVERIFY(iconNameChangedSpy.isValid());
QCOMPARE(notification.iconName(), QString());
notification.setIconName(QStringLiteral("foo"));
QCOMPARE(notification.iconName(), QStringLiteral("foo"));
@ -113,7 +112,6 @@ void OnScreenNotificationTest::message()
{
OnScreenNotification notification;
QSignalSpy messageChangedSpy(&notification, &OnScreenNotification::messageChanged);
QVERIFY(messageChangedSpy.isValid());
QCOMPARE(notification.message(), QString());
notification.setMessage(QStringLiteral("foo"));
QCOMPARE(notification.message(), QStringLiteral("foo"));

View file

@ -364,13 +364,9 @@ void GestureTest::testMinimumDeltaReached()
recognizer.registerSwipeGesture(&gesture);
QSignalSpy startedSpy(&gesture, &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
QSignalSpy triggeredSpy(&gesture, &SwipeGesture::triggered);
QVERIFY(triggeredSpy.isValid());
QSignalSpy cancelledSpy(&gesture, &SwipeGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
QSignalSpy progressSpy(&gesture, &SwipeGesture::progress);
QVERIFY(progressSpy.isValid());
recognizer.startSwipeGesture(1);
QCOMPARE(startedSpy.count(), 1);
@ -408,13 +404,9 @@ void GestureTest::testMinimumScaleDelta()
recognizer.registerPinchGesture(&gesture);
QSignalSpy startedSpy(&gesture, &PinchGesture::started);
QVERIFY(startedSpy.isValid());
QSignalSpy triggeredSpy(&gesture, &PinchGesture::triggered);
QVERIFY(triggeredSpy.isValid());
QSignalSpy cancelledSpy(&gesture, &PinchGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
QSignalSpy progressSpy(&gesture, &PinchGesture::progress);
QVERIFY(progressSpy.isValid());
recognizer.startPinchGesture(4);
QCOMPARE(startedSpy.count(), 1);
@ -428,9 +420,7 @@ void GestureTest::testUnregisterSwipeCancels()
GestureRecognizer recognizer;
std::unique_ptr<SwipeGesture> gesture(new SwipeGesture);
QSignalSpy startedSpy(gesture.get(), &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
QSignalSpy cancelledSpy(gesture.get(), &SwipeGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
recognizer.registerSwipeGesture(gesture.get());
recognizer.startSwipeGesture(1);
@ -449,9 +439,7 @@ void GestureTest::testUnregisterPinchCancels()
GestureRecognizer recognizer;
std::unique_ptr<PinchGesture> gesture(new PinchGesture);
QSignalSpy startedSpy(gesture.get(), &PinchGesture::started);
QVERIFY(startedSpy.isValid());
QSignalSpy cancelledSpy(gesture.get(), &PinchGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
recognizer.registerPinchGesture(gesture.get());
recognizer.startPinchGesture(1);
@ -470,9 +458,7 @@ void GestureTest::testDeleteSwipeCancels()
GestureRecognizer recognizer;
std::unique_ptr<SwipeGesture> gesture(new SwipeGesture);
QSignalSpy startedSpy(gesture.get(), &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
QSignalSpy cancelledSpy(gesture.get(), &SwipeGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
recognizer.registerSwipeGesture(gesture.get());
recognizer.startSwipeGesture(1);
@ -499,11 +485,8 @@ void GestureTest::testSwipeCancel()
QFETCH(SwipeGesture::Direction, direction);
gesture->setDirection(direction);
QSignalSpy startedSpy(gesture.get(), &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
QSignalSpy cancelledSpy(gesture.get(), &SwipeGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
QSignalSpy triggeredSpy(gesture.get(), &SwipeGesture::triggered);
QVERIFY(triggeredSpy.isValid());
recognizer.registerSwipeGesture(gesture.get());
recognizer.startSwipeGesture(1);
@ -533,9 +516,7 @@ void GestureTest::testSwipeUpdateTrigger()
gesture.setDirection(direction);
QSignalSpy triggeredSpy(&gesture, &SwipeGesture::triggered);
QVERIFY(triggeredSpy.isValid());
QSignalSpy cancelledSpy(&gesture, &SwipeGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
recognizer.registerSwipeGesture(&gesture);
@ -569,7 +550,6 @@ void GestureTest::testSwipeMinFingerStart()
gesture.setMinimumFingerCount(min);
QSignalSpy startedSpy(&gesture, &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
recognizer.registerSwipeGesture(&gesture);
QFETCH(uint, count);
@ -596,7 +576,6 @@ void GestureTest::testSwipeMaxFingerStart()
gesture.setMaximumFingerCount(max);
QSignalSpy startedSpy(&gesture, &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
recognizer.registerSwipeGesture(&gesture);
QFETCH(uint, count);
@ -699,7 +678,6 @@ void GestureTest::testSwipeGeometryStart()
gesture.setStartGeometry(geometry);
QSignalSpy startedSpy(&gesture, &SwipeGesture::started);
QVERIFY(startedSpy.isValid());
recognizer.registerSwipeGesture(&gesture);
QFETCH(QPointF, startPos);

View file

@ -92,11 +92,8 @@ void TestDataDevice::init()
KWayland::Client::Registry registry;
QSignalSpy dataDeviceManagerSpy(&registry, &KWayland::Client::Registry::dataDeviceManagerAnnounced);
QVERIFY(dataDeviceManagerSpy.isValid());
QSignalSpy seatSpy(&registry, &KWayland::Client::Registry::seatAnnounced);
QVERIFY(seatSpy.isValid());
QSignalSpy compositorSpy(&registry, &KWayland::Client::Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
QCOMPARE(registry.eventQueue(), m_queue);
@ -117,7 +114,6 @@ void TestDataDevice::init()
m_seat = registry.createSeat(seatSpy.first().first().value<quint32>(), seatSpy.first().last().value<quint32>(), this);
QVERIFY(m_seat->isValid());
QSignalSpy pointerChangedSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged);
QVERIFY(pointerChangedSpy.isValid());
QVERIFY(pointerChangedSpy.wait());
m_compositorInterface = new CompositorInterface(m_display, m_display);
@ -163,7 +159,6 @@ void TestDataDevice::testCreate()
using namespace KWaylandServer;
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -182,7 +177,6 @@ void TestDataDevice::testCreate()
// and destroy
QSignalSpy destroyedSpy(deviceInterface, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
dataDevice.reset();
QVERIFY(destroyedSpy.wait());
QVERIFY(!m_seatInterface->selection());
@ -207,7 +201,6 @@ void TestDataDevice::testDrag()
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -218,7 +211,6 @@ void TestDataDevice::testDrag()
QVERIFY(deviceInterface);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -229,7 +221,6 @@ void TestDataDevice::testDrag()
QVERIFY(sourceInterface);
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
@ -240,7 +231,6 @@ void TestDataDevice::testDrag()
// now we have all we need to start a drag operation
QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted);
QVERIFY(dragStartedSpy.isValid());
// first we need to fake the pointer enter
QFETCH(bool, hasGrab);
@ -292,7 +282,6 @@ void TestDataDevice::testDragInternally()
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -303,7 +292,6 @@ void TestDataDevice::testDragInternally()
QVERIFY(deviceInterface);
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
@ -321,7 +309,6 @@ void TestDataDevice::testDragInternally()
// now we have all we need to start a drag operation
QSignalSpy dragStartedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::dragStarted);
QVERIFY(dragStartedSpy.isValid());
// first we need to fake the pointer enter
QFETCH(bool, hasGrab);
@ -366,7 +353,6 @@ void TestDataDevice::testSetSelection()
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
@ -377,7 +363,6 @@ void TestDataDevice::testSetSelection()
QVERIFY(deviceInterface);
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -390,9 +375,7 @@ void TestDataDevice::testSetSelection()
// everything setup, now we can test setting the selection
QSignalSpy selectionChangedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::selectionChanged);
QVERIFY(selectionChangedSpy.isValid());
QSignalSpy selectionClearedSpy(deviceInterface, &KWaylandServer::DataDeviceInterface::selectionCleared);
QVERIFY(selectionClearedSpy.isValid());
QVERIFY(!deviceInterface->selection());
dataDevice->setSelection(1, dataSource.get());
@ -404,7 +387,6 @@ void TestDataDevice::testSetSelection()
// send selection to datadevice
QSignalSpy selectionOfferedSpy(dataDevice.get(), &KWayland::Client::DataDevice::selectionOffered);
QVERIFY(selectionOfferedSpy.isValid());
deviceInterface->sendSelection(deviceInterface->selection());
QVERIFY(selectionOfferedSpy.wait());
QCOMPARE(selectionOfferedSpy.count(), 1);
@ -415,7 +397,6 @@ void TestDataDevice::testSetSelection()
// sending a new mimetype to the selection, should be announced in the offer
QSignalSpy mimeTypeAddedSpy(dataOffer, &KWayland::Client::DataOffer::mimeTypeOffered);
QVERIFY(mimeTypeAddedSpy.isValid());
dataSource->offer(QStringLiteral("text/html"));
QVERIFY(mimeTypeAddedSpy.wait());
QCOMPARE(mimeTypeAddedSpy.count(), 1);
@ -436,7 +417,6 @@ void TestDataDevice::testSetSelection()
QVERIFY(selectionChangedSpy.wait());
// now unbind the dataDevice
QSignalSpy unboundSpy(deviceInterface, &QObject::destroyed);
QVERIFY(unboundSpy.isValid());
dataDevice.reset();
QVERIFY(unboundSpy.wait());
}
@ -448,12 +428,10 @@ void TestDataDevice::testSendSelectionOnSeat()
using namespace KWaylandServer;
// first add keyboard support to Seat
QSignalSpy keyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged);
QVERIFY(keyboardChangedSpy.isValid());
m_seatInterface->setHasKeyboard(true);
QVERIFY(keyboardChangedSpy.wait());
// now create DataDevice, Keyboard and a Surface
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
QVERIFY(dataDeviceCreatedSpy.wait());
@ -462,7 +440,6 @@ void TestDataDevice::testSendSelectionOnSeat()
std::unique_ptr<Keyboard> keyboard(m_seat->createKeyboard());
QVERIFY(keyboard->isValid());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -478,7 +455,6 @@ void TestDataDevice::testSendSelectionOnSeat()
dataDevice->setSelection(1, dataSource.get());
// we should get a selection offered for that on the data device
QSignalSpy selectionOfferedSpy(dataDevice.get(), &DataDevice::selectionOffered);
QVERIFY(selectionOfferedSpy.isValid());
QVERIFY(selectionOfferedSpy.wait());
QCOMPARE(selectionOfferedSpy.count(), 1);
@ -492,7 +468,6 @@ void TestDataDevice::testSendSelectionOnSeat()
// now let's try to destroy the data device and set a focused keyboard just while the data device is being destroyedd
m_seatInterface->setFocusedKeyboardSurface(nullptr);
QSignalSpy unboundSpy(serverDataDevice, &QObject::destroyed);
QVERIFY(unboundSpy.isValid());
dataDevice.reset();
QVERIFY(unboundSpy.wait());
m_seatInterface->setFocusedKeyboardSurface(serverSurface);
@ -505,12 +480,10 @@ void TestDataDevice::testReplaceSource()
using namespace KWaylandServer;
// first add keyboard support to Seat
QSignalSpy keyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged);
QVERIFY(keyboardChangedSpy.isValid());
m_seatInterface->setHasKeyboard(true);
QVERIFY(keyboardChangedSpy.wait());
// now create DataDevice, Keyboard and a Surface
QSignalSpy dataDeviceCreatedSpy(m_dataDeviceManagerInterface, &DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(dataDeviceCreatedSpy.isValid());
std::unique_ptr<DataDevice> dataDevice(m_dataDeviceManager->getDataDevice(m_seat));
QVERIFY(dataDevice->isValid());
QVERIFY(dataDeviceCreatedSpy.wait());
@ -519,7 +492,6 @@ void TestDataDevice::testReplaceSource()
std::unique_ptr<Keyboard> keyboard(m_seat->createKeyboard());
QVERIFY(keyboard->isValid());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -534,10 +506,8 @@ void TestDataDevice::testReplaceSource()
dataSource->offer(QStringLiteral("text/plain"));
dataDevice->setSelection(1, dataSource.get());
QSignalSpy sourceCancelledSpy(dataSource.get(), &DataSource::cancelled);
QVERIFY(sourceCancelledSpy.isValid());
// we should get a selection offered for that on the data device
QSignalSpy selectionOfferedSpy(dataDevice.get(), &DataDevice::selectionOffered);
QVERIFY(selectionOfferedSpy.isValid());
QVERIFY(selectionOfferedSpy.wait());
QCOMPARE(selectionOfferedSpy.count(), 1);
@ -546,7 +516,6 @@ void TestDataDevice::testReplaceSource()
QVERIFY(dataSource2->isValid());
dataSource2->offer(QStringLiteral("text/plain"));
QSignalSpy sourceCancelled2Spy(dataSource2.get(), &DataSource::cancelled);
QVERIFY(sourceCancelled2Spy.isValid());
dataDevice->setSelection(1, dataSource2.get());
QCOMPARE(selectionOfferedSpy.count(), 1);
QVERIFY(sourceCancelledSpy.wait());

View file

@ -74,7 +74,6 @@ void TestDataSource::init()
KWayland::Client::Registry registry;
QSignalSpy dataDeviceManagerSpy(&registry, &KWayland::Client::Registry::dataDeviceManagerAnnounced);
QVERIFY(dataDeviceManagerSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
QCOMPARE(registry.eventQueue(), m_queue);
@ -119,7 +118,6 @@ void TestDataSource::testOffer()
qRegisterMetaType<KWaylandServer::DataSourceInterface *>();
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataSourceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
@ -132,7 +130,6 @@ void TestDataSource::testOffer()
QCOMPARE(serverDataSource->mimeTypes().count(), 0);
QSignalSpy offeredSpy(serverDataSource.data(), &KWaylandServer::AbstractDataSource::mimeTypeOffered);
QVERIFY(offeredSpy.isValid());
const QString plain = QStringLiteral("text/plain");
QMimeDatabase db;
@ -177,13 +174,11 @@ void TestDataSource::testTargetAccepts()
using namespace KWaylandServer;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataSourceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
QSignalSpy targetAcceptsSpy(dataSource.get(), &KWayland::Client::DataSource::targetAccepts);
QVERIFY(targetAcceptsSpy.isValid());
QVERIFY(dataSourceCreatedSpy.wait());
QCOMPARE(dataSourceCreatedSpy.count(), 1);
@ -202,12 +197,10 @@ void TestDataSource::testRequestSend()
using namespace KWaylandServer;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataSourceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
QSignalSpy sendRequestedSpy(dataSource.get(), &KWayland::Client::DataSource::sendDataRequested);
QVERIFY(sendRequestedSpy.isValid());
const QString plain = QStringLiteral("text/plain");
QVERIFY(dataSourceCreatedSpy.wait());
@ -233,12 +226,10 @@ void TestDataSource::testCancel()
using namespace KWaylandServer;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataSourceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());
QSignalSpy cancelledSpy(dataSource.get(), &KWayland::Client::DataSource::cancelled);
QVERIFY(cancelledSpy.isValid());
QVERIFY(dataSourceCreatedSpy.wait());
@ -255,7 +246,6 @@ void TestDataSource::testServerGet()
using namespace KWaylandServer;
QSignalSpy dataSourceCreatedSpy(m_dataDeviceManagerInterface, &KWaylandServer::DataDeviceManagerInterface::dataSourceCreated);
QVERIFY(dataSourceCreatedSpy.isValid());
std::unique_ptr<DataSource> dataSource(m_dataDeviceManager->createDataSource());
QVERIFY(dataSource->isValid());

View file

@ -76,7 +76,6 @@ void TestDragAndDrop::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_compositorInterface = new CompositorInterface(m_display, m_display);
@ -100,7 +99,6 @@ void TestDragAndDrop::init()
m_registry = new Registry();
QSignalSpy interfacesAnnouncedSpy(m_registry, &Registry::interfaceAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
QVERIFY(!m_registry->eventQueue());
m_registry->setEventQueue(m_queue);
@ -123,7 +121,6 @@ void TestDragAndDrop::init()
#undef CREATE
QSignalSpy pointerSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
QVERIFY(pointerSpy.wait());
m_pointer = m_seat->createPointer(m_seat);
QVERIFY(m_pointer->isValid());
@ -202,11 +199,9 @@ void TestDragAndDrop::testPointerDragAndDrop()
QVERIFY(serverSurface);
QSignalSpy dataSourceSelectedActionChangedSpy(m_dataSource, &DataSource::selectedDragAndDropActionChanged);
QVERIFY(dataSourceSelectedActionChangedSpy.isValid());
// now we need to pass pointer focus to the Surface and simulate a button press
QSignalSpy buttonPressSpy(m_pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonPressSpy.isValid());
m_seatInterface->setTimestamp(2);
m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0));
m_seatInterface->notifyPointerButton(1, PointerButtonState::Pressed);
@ -216,17 +211,12 @@ void TestDragAndDrop::testPointerDragAndDrop()
// add some signal spies for client side
QSignalSpy dragEnteredSpy(m_dataDevice, &DataDevice::dragEntered);
QVERIFY(dragEnteredSpy.isValid());
QSignalSpy dragMotionSpy(m_dataDevice, &DataDevice::dragMotion);
QVERIFY(dragMotionSpy.isValid());
QSignalSpy pointerMotionSpy(m_pointer, &Pointer::motion);
QVERIFY(pointerMotionSpy.isValid());
QSignalSpy sourceDropSpy(m_dataSource, &DataSource::dragAndDropPerformed);
QVERIFY(sourceDropSpy.isValid());
// now we can start the drag and drop
QSignalSpy dragStartedSpy(m_seatInterface, &SeatInterface::dragStarted);
QVERIFY(dragStartedSpy.isValid());
m_dataSource->setDragAndDropActions(DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move);
m_dataDevice->startDrag(buttonPressSpy.first().first().value<quint32>(), m_dataSource, s.get());
QVERIFY(dragStartedSpy.wait());
@ -243,7 +233,6 @@ void TestDragAndDrop::testPointerDragAndDrop()
QVERIFY(offer);
QCOMPARE(offer->selectedDragAndDropAction(), DataDeviceManager::DnDAction::None);
QSignalSpy offerActionChangedSpy(offer, &DataOffer::selectedDragAndDropActionChanged);
QVERIFY(offerActionChangedSpy.isValid());
QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().count(), 1);
QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().first().name(), QStringLiteral("text/plain"));
QTRY_COMPARE(offer->sourceDragAndDropActions(), DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move);
@ -266,9 +255,7 @@ void TestDragAndDrop::testPointerDragAndDrop()
// simulate drop
QSignalSpy serverDragEndedSpy(m_seatInterface, &SeatInterface::dragEnded);
QVERIFY(serverDragEndedSpy.isValid());
QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped);
QVERIFY(droppedSpy.isValid());
m_seatInterface->setTimestamp(4);
m_seatInterface->notifyPointerButton(1, PointerButtonState::Released);
m_seatInterface->notifyPointerFrame();
@ -278,7 +265,6 @@ void TestDragAndDrop::testPointerDragAndDrop()
QCOMPARE(serverDragEndedSpy.count(), 1);
QSignalSpy finishedSpy(m_dataSource, &DataSource::dragAndDropFinished);
QVERIFY(finishedSpy.isValid());
offer->dragAndDropFinished();
QVERIFY(finishedSpy.wait());
delete offer;
@ -300,13 +286,10 @@ void TestDragAndDrop::testTouchDragAndDrop()
QVERIFY(serverSurface);
QSignalSpy dataSourceSelectedActionChangedSpy(m_dataSource, &DataSource::selectedDragAndDropActionChanged);
QVERIFY(dataSourceSelectedActionChangedSpy.isValid());
// now we need to pass touch focus to the Surface and simulate a touch down
QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted);
QVERIFY(sequenceStartedSpy.isValid());
QSignalSpy pointAddedSpy(m_touch, &Touch::pointAdded);
QVERIFY(pointAddedSpy.isValid());
m_seatInterface->setFocusedTouchSurface(serverSurface);
m_seatInterface->setTimestamp(2);
const qint32 touchId = 0;
@ -319,17 +302,12 @@ void TestDragAndDrop::testTouchDragAndDrop()
// add some signal spies for client side
QSignalSpy dragEnteredSpy(m_dataDevice, &DataDevice::dragEntered);
QVERIFY(dragEnteredSpy.isValid());
QSignalSpy dragMotionSpy(m_dataDevice, &DataDevice::dragMotion);
QVERIFY(dragMotionSpy.isValid());
QSignalSpy touchMotionSpy(m_touch, &Touch::pointMoved);
QVERIFY(touchMotionSpy.isValid());
QSignalSpy sourceDropSpy(m_dataSource, &DataSource::dragAndDropPerformed);
QVERIFY(sourceDropSpy.isValid());
// now we can start the drag and drop
QSignalSpy dragStartedSpy(m_seatInterface, &SeatInterface::dragStarted);
QVERIFY(dragStartedSpy.isValid());
m_dataSource->setDragAndDropActions(DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move);
m_dataDevice->startDrag(tp->downSerial(), m_dataSource, s.get());
QVERIFY(dragStartedSpy.wait());
@ -346,7 +324,6 @@ void TestDragAndDrop::testTouchDragAndDrop()
QVERIFY(offer);
QCOMPARE(offer->selectedDragAndDropAction(), DataDeviceManager::DnDAction::None);
QSignalSpy offerActionChangedSpy(offer, &DataOffer::selectedDragAndDropActionChanged);
QVERIFY(offerActionChangedSpy.isValid());
QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().count(), 1);
QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().first().name(), QStringLiteral("text/plain"));
QTRY_COMPARE(offer->sourceDragAndDropActions(), DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move);
@ -368,9 +345,7 @@ void TestDragAndDrop::testTouchDragAndDrop()
// simulate drop
QSignalSpy serverDragEndedSpy(m_seatInterface, &SeatInterface::dragEnded);
QVERIFY(serverDragEndedSpy.isValid());
QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped);
QVERIFY(droppedSpy.isValid());
m_seatInterface->setTimestamp(4);
m_seatInterface->notifyTouchUp(touchId);
QVERIFY(sourceDropSpy.isEmpty());
@ -379,7 +354,6 @@ void TestDragAndDrop::testTouchDragAndDrop()
QCOMPARE(serverDragEndedSpy.count(), 1);
QSignalSpy finishedSpy(m_dataSource, &DataSource::dragAndDropFinished);
QVERIFY(finishedSpy.isValid());
offer->dragAndDropFinished();
QVERIFY(finishedSpy.wait());
delete offer;
@ -400,11 +374,9 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
QVERIFY(serverSurface);
QSignalSpy dataSourceSelectedActionChangedSpy(m_dataSource, &DataSource::selectedDragAndDropActionChanged);
QVERIFY(dataSourceSelectedActionChangedSpy.isValid());
// now we need to pass pointer focus to the Surface and simulate a button press
QSignalSpy buttonPressSpy(m_pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonPressSpy.isValid());
m_seatInterface->setTimestamp(2);
m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0));
m_seatInterface->notifyPointerButton(1, PointerButtonState::Pressed);
@ -414,17 +386,12 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
// add some signal spies for client side
QSignalSpy dragEnteredSpy(m_dataDevice, &DataDevice::dragEntered);
QVERIFY(dragEnteredSpy.isValid());
QSignalSpy dragMotionSpy(m_dataDevice, &DataDevice::dragMotion);
QVERIFY(dragMotionSpy.isValid());
QSignalSpy pointerMotionSpy(m_pointer, &Pointer::motion);
QVERIFY(pointerMotionSpy.isValid());
QSignalSpy dragLeftSpy(m_dataDevice, &DataDevice::dragLeft);
QVERIFY(dragLeftSpy.isValid());
// now we can start the drag and drop
QSignalSpy dragStartedSpy(m_seatInterface, &SeatInterface::dragStarted);
QVERIFY(dragStartedSpy.isValid());
m_dataSource->setDragAndDropActions(DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move);
m_dataDevice->startDrag(buttonPressSpy.first().first().value<quint32>(), m_dataSource, s.get());
QVERIFY(dragStartedSpy.wait());
@ -441,7 +408,6 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
QVERIFY(offer);
QCOMPARE(offer->selectedDragAndDropAction(), DataDeviceManager::DnDAction::None);
QSignalSpy offerActionChangedSpy(offer, &DataOffer::selectedDragAndDropActionChanged);
QVERIFY(offerActionChangedSpy.isValid());
QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().count(), 1);
QCOMPARE(m_dataDevice->dragOffer()->offeredMimeTypes().first().name(), QStringLiteral("text/plain"));
QTRY_COMPARE(offer->sourceDragAndDropActions(), DataDeviceManager::DnDAction::Copy | DataDeviceManager::DnDAction::Move);
@ -466,7 +432,6 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
delete m_dataSource;
m_dataSource = nullptr;
QSignalSpy serverDragEndedSpy(m_seatInterface, &SeatInterface::dragEnded);
QVERIFY(serverDragEndedSpy.isValid());
QVERIFY(dragLeftSpy.isEmpty());
QVERIFY(dragLeftSpy.wait());
QTRY_COMPARE(dragLeftSpy.count(), 1);
@ -474,7 +439,6 @@ void TestDragAndDrop::testDragAndDropWithCancelByDestroyDataSource()
// simulate drop
QSignalSpy droppedSpy(m_dataDevice, &DataDevice::dropped);
QVERIFY(droppedSpy.isValid());
m_seatInterface->setTimestamp(4);
m_seatInterface->notifyPointerButton(1, PointerButtonState::Released);
m_seatInterface->notifyPointerFrame();
@ -500,17 +464,11 @@ void TestDragAndDrop::testPointerEventsIgnored()
// create signal spies for all the pointer events
QSignalSpy pointerEnteredSpy(m_pointer, &Pointer::entered);
QVERIFY(pointerEnteredSpy.isValid());
QSignalSpy pointerLeftSpy(m_pointer, &Pointer::left);
QVERIFY(pointerLeftSpy.isValid());
QSignalSpy pointerMotionSpy(m_pointer, &Pointer::motion);
QVERIFY(pointerMotionSpy.isValid());
QSignalSpy axisSpy(m_pointer, &Pointer::axisChanged);
QVERIFY(axisSpy.isValid());
QSignalSpy buttonSpy(m_pointer, &Pointer::buttonStateChanged);
QVERIFY(buttonSpy.isValid());
QSignalSpy dragEnteredSpy(m_dataDevice, &DataDevice::dragEntered);
QVERIFY(dragEnteredSpy.isValid());
// first simulate a few things
quint32 timestamp = 1;
@ -561,7 +519,6 @@ void TestDragAndDrop::testPointerEventsIgnored()
// last but not least, simulate the drop
QSignalSpy cancelledSpy(m_dataSource, &DataSource::cancelled);
QVERIFY(cancelledSpy.isValid());
m_seatInterface->setTimestamp(timestamp++);
m_seatInterface->notifyPointerButton(1, PointerButtonState::Released);
m_seatInterface->notifyPointerFrame();

View file

@ -62,7 +62,6 @@ void ErrorTest::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -77,7 +76,6 @@ void ErrorTest::init()
Registry registry;
QSignalSpy interfacesAnnouncedSpy(&registry, &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
registry.setEventQueue(m_queue);
registry.create(m_connection);
QVERIFY(registry.isValid());
@ -124,7 +122,6 @@ void ErrorTest::testMultiplePlasmaShellSurfacesForSurface()
{
// this test verifies that creating two ShellSurfaces for the same Surface triggers a protocol error
QSignalSpy errorSpy(m_connection, &ConnectionThread::errorOccurred);
QVERIFY(errorSpy.isValid());
// PlasmaShell is too smart and doesn't allow us to create a second PlasmaShellSurface
// thus we need to cheat by creating a surface manually
auto surface = wl_compositor_create_surface(*m_compositor);

View file

@ -63,12 +63,10 @@ void FakeInputTest::init()
m_display->createShm();
m_fakeInputInterface = new FakeInputInterface(m_display);
QSignalSpy deviceCreatedSpy(m_fakeInputInterface, &FakeInputInterface::deviceCreated);
QVERIFY(deviceCreatedSpy.isValid());
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -83,7 +81,6 @@ void FakeInputTest::init()
Registry registry;
QSignalSpy interfacesAnnouncedSpy(&registry, &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
registry.setEventQueue(m_queue);
registry.create(m_connection);
QVERIFY(registry.isValid());
@ -131,7 +128,6 @@ void FakeInputTest::testAuthenticate()
// this test verifies that an authenticate request is passed to the Server
QVERIFY(!m_device->isAuthenticated());
QSignalSpy authenticationRequestedSpy(m_device, &FakeInputDevice::authenticationRequested);
QVERIFY(authenticationRequestedSpy.isValid());
m_fakeInput->authenticate(QStringLiteral("test-case"), QStringLiteral("to test"));
QVERIFY(authenticationRequestedSpy.wait());
@ -147,7 +143,6 @@ void FakeInputTest::testMotion()
// this test verifies that motion is properly passed to the server
QVERIFY(!m_device->isAuthenticated());
QSignalSpy motionSpy(m_device, &FakeInputDevice::pointerMotionRequested);
QVERIFY(motionSpy.isValid());
// without an authentication we shouldn't get the signals
m_fakeInput->requestPointerMove(QSizeF(1, 2));
@ -172,7 +167,6 @@ void FakeInputTest::testMotionAbsolute()
// this test verifies that motion is properly passed to the server
QVERIFY(!m_device->isAuthenticated());
QSignalSpy motionSpy(m_device, &FakeInputDevice::pointerMotionAbsoluteRequested);
QVERIFY(motionSpy.isValid());
// without an authentication we shouldn't get the signals
m_fakeInput->requestPointerMoveAbsolute(QPointF(1, 2));
@ -207,9 +201,7 @@ void FakeInputTest::testPointerButtonQt()
// this test verifies that pointer button events are properly passed to the server with Qt button codes
QVERIFY(!m_device->isAuthenticated());
QSignalSpy pressedSpy(m_device, &FakeInputDevice::pointerButtonPressRequested);
QVERIFY(pressedSpy.isValid());
QSignalSpy releasedSpy(m_device, &FakeInputDevice::pointerButtonReleaseRequested);
QVERIFY(releasedSpy.isValid());
// without an authentication we shouldn't get the signals
QFETCH(Qt::MouseButton, qtButton);
@ -261,9 +253,7 @@ void FakeInputTest::testPointerButtonLinux()
// this test verifies that pointer button events are properly passed to the server with Qt button codes
QVERIFY(!m_device->isAuthenticated());
QSignalSpy pressedSpy(m_device, &FakeInputDevice::pointerButtonPressRequested);
QVERIFY(pressedSpy.isValid());
QSignalSpy releasedSpy(m_device, &FakeInputDevice::pointerButtonReleaseRequested);
QVERIFY(releasedSpy.isValid());
// without an authentication we shouldn't get the signals
QFETCH(quint32, linuxButton);
@ -312,7 +302,6 @@ void FakeInputTest::testAxis()
// this test verifies that pointer axis events are properly passed to the server
QVERIFY(!m_device->isAuthenticated());
QSignalSpy axisSpy(m_device, &FakeInputDevice::pointerAxisRequested);
QVERIFY(axisSpy.isValid());
QFETCH(Qt::Orientation, orientation);
QFETCH(qreal, delta);
@ -335,15 +324,10 @@ void FakeInputTest::testTouch()
{
QVERIFY(!m_device->isAuthenticated());
QSignalSpy touchDownSpy(m_device, &FakeInputDevice::touchDownRequested);
QVERIFY(touchDownSpy.isValid());
QSignalSpy touchMotionSpy(m_device, &FakeInputDevice::touchMotionRequested);
QVERIFY(touchMotionSpy.isValid());
QSignalSpy touchUpSpy(m_device, &FakeInputDevice::touchUpRequested);
QVERIFY(touchUpSpy.isValid());
QSignalSpy touchFrameSpy(m_device, &FakeInputDevice::touchFrameRequested);
QVERIFY(touchFrameSpy.isValid());
QSignalSpy touchCancelSpy(m_device, &FakeInputDevice::touchCancelRequested);
QVERIFY(touchCancelSpy.isValid());
// without an authentication we shouldn't get the signals
m_fakeInput->requestTouchDown(0, QPointF(1, 2));
@ -425,9 +409,7 @@ void FakeInputTest::testKeyboardKeyLinux()
// this test verifies that keyboard key events are properly passed to the server with Qt button codes
QVERIFY(!m_device->isAuthenticated());
QSignalSpy pressedSpy(m_device, &FakeInputDevice::keyboardKeyPressRequested);
QVERIFY(pressedSpy.isValid());
QSignalSpy releasedSpy(m_device, &FakeInputDevice::keyboardKeyReleaseRequested);
QVERIFY(releasedSpy.isValid());
// without an authentication we shouldn't get the signals
QFETCH(quint32, linuxKey);

View file

@ -71,7 +71,6 @@ void TestActivities::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -88,10 +87,8 @@ void TestActivities::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy windowManagementSpy(&registry, &Registry::plasmaWindowManagementAnnounced);
QVERIFY(windowManagementSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -111,7 +108,6 @@ void TestActivities::init()
registry.createPlasmaWindowManagement(windowManagementSpy.first().first().value<quint32>(), windowManagementSpy.first().last().value<quint32>(), this);
QSignalSpy windowSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(windowSpy.isValid());
m_windowInterface = m_windowManagementInterface->createWindow(this, QUuid::createUuid());
m_windowInterface->setPid(1337);

View file

@ -84,7 +84,6 @@ void TestVirtualDesktop::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -101,13 +100,10 @@ void TestVirtualDesktop::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy plasmaVirtualDesktopManagementSpy(&registry, &Registry::plasmaVirtualDesktopManagementAnnounced);
QVERIFY(plasmaVirtualDesktopManagementSpy.isValid());
QSignalSpy windowManagementSpy(&registry, &Registry::plasmaWindowManagementAnnounced);
QVERIFY(windowManagementSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -135,7 +131,6 @@ void TestVirtualDesktop::init()
registry.createPlasmaWindowManagement(windowManagementSpy.first().first().value<quint32>(), windowManagementSpy.first().last().value<quint32>(), this);
QSignalSpy windowSpy(m_windowManagement, &PlasmaWindowManagement::windowCreated);
QVERIFY(windowSpy.isValid());
m_windowInterface = m_windowManagementInterface->createWindow(this, QUuid::createUuid());
m_windowInterface->setPid(1337);
@ -272,7 +267,6 @@ void TestVirtualDesktop::testConnectNewClient()
registry.setup();
QSignalSpy plasmaVirtualDesktopManagementSpy(&registry, &Registry::plasmaVirtualDesktopManagementAnnounced);
QVERIFY(plasmaVirtualDesktopManagementSpy.isValid());
QVERIFY(plasmaVirtualDesktopManagementSpy.wait());

View file

@ -70,7 +70,6 @@ void TestPlasmaShell::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -87,7 +86,6 @@ void TestPlasmaShell::init()
m_registry = new Registry();
QSignalSpy interfacesAnnouncedSpy(m_registry, &Registry::interfaceAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
QVERIFY(!m_registry->eventQueue());
m_registry->setEventQueue(m_queue);
@ -153,9 +151,7 @@ void TestPlasmaShell::testRole()
// first create signal spies
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
// create the surface
std::unique_ptr<Surface> s(m_compositor->createSurface());
@ -185,7 +181,6 @@ void TestPlasmaShell::testRole()
// now change it
QSignalSpy roleChangedSpy(sps, &PlasmaShellSurfaceInterface::roleChanged);
QVERIFY(roleChangedSpy.isValid());
QFETCH(PlasmaShellSurface::Role, clientRole);
ps->setRole(clientRole);
QCOMPARE(ps->role(), clientRole);
@ -209,7 +204,6 @@ void TestPlasmaShell::testPosition()
{
// this test verifies that updating the position of a PlasmaShellSurface is properly passed to the server
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
@ -227,7 +221,6 @@ void TestPlasmaShell::testPosition()
// now let's try to change the position
QSignalSpy positionChangedSpy(sps, &PlasmaShellSurfaceInterface::positionChanged);
QVERIFY(positionChangedSpy.isValid());
ps->setPosition(QPoint(1, 2));
QVERIFY(positionChangedSpy.wait());
QCOMPARE(positionChangedSpy.count(), 1);
@ -248,7 +241,6 @@ void TestPlasmaShell::testSkipTaskbar()
{
// this test verifies that sip taskbar is properly passed to server
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
@ -263,7 +255,6 @@ void TestPlasmaShell::testSkipTaskbar()
// now change
QSignalSpy skipTaskbarChangedSpy(sps, &PlasmaShellSurfaceInterface::skipTaskbarChanged);
QVERIFY(skipTaskbarChangedSpy.isValid());
ps->setSkipTaskbar(true);
QVERIFY(skipTaskbarChangedSpy.wait());
QVERIFY(sps->skipTaskbar());
@ -283,7 +274,6 @@ void TestPlasmaShell::testSkipSwitcher()
{
// this test verifies that Skip Switcher is properly passed to server
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
@ -298,7 +288,6 @@ void TestPlasmaShell::testSkipSwitcher()
// now change
QSignalSpy skipSwitcherChangedSpy(sps, &PlasmaShellSurfaceInterface::skipSwitcherChanged);
QVERIFY(skipSwitcherChangedSpy.isValid());
ps->setSkipSwitcher(true);
QVERIFY(skipSwitcherChangedSpy.wait());
QVERIFY(sps->skipSwitcher());
@ -328,7 +317,6 @@ void TestPlasmaShell::testPanelBehavior()
{
// this test verifies that the panel behavior is properly passed to the server
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
@ -344,7 +332,6 @@ void TestPlasmaShell::testPanelBehavior()
// now change the behavior
QSignalSpy behaviorChangedSpy(sps, &PlasmaShellSurfaceInterface::panelBehaviorChanged);
QVERIFY(behaviorChangedSpy.isValid());
QFETCH(PlasmaShellSurface::PanelBehavior, client);
ps->setPanelBehavior(client);
QVERIFY(behaviorChangedSpy.wait());
@ -364,7 +351,6 @@ void TestPlasmaShell::testAutoHidePanel()
{
// this test verifies that auto-hiding panels work correctly
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
@ -377,18 +363,14 @@ void TestPlasmaShell::testAutoHidePanel()
QCOMPARE(sps->panelBehavior(), PlasmaShellSurfaceInterface::PanelBehavior::AutoHide);
QSignalSpy autoHideRequestedSpy(sps, &PlasmaShellSurfaceInterface::panelAutoHideHideRequested);
QVERIFY(autoHideRequestedSpy.isValid());
QSignalSpy autoHideShowRequestedSpy(sps, &PlasmaShellSurfaceInterface::panelAutoHideShowRequested);
QVERIFY(autoHideShowRequestedSpy.isValid());
ps->requestHideAutoHidingPanel();
QVERIFY(autoHideRequestedSpy.wait());
QCOMPARE(autoHideRequestedSpy.count(), 1);
QCOMPARE(autoHideShowRequestedSpy.count(), 0);
QSignalSpy panelShownSpy(ps.get(), &PlasmaShellSurface::autoHidePanelShown);
QVERIFY(panelShownSpy.isValid());
QSignalSpy panelHiddenSpy(ps.get(), &PlasmaShellSurface::autoHidePanelHidden);
QVERIFY(panelHiddenSpy.isValid());
sps->hideAutoHidingPanel();
QVERIFY(panelHiddenSpy.wait());
@ -409,7 +391,6 @@ void TestPlasmaShell::testAutoHidePanel()
ps->setPanelBehavior(PlasmaShellSurface::PanelBehavior::AlwaysVisible);
// requesting auto hide should raise error
QSignalSpy errorSpy(m_connection, &ConnectionThread::errorOccurred);
QVERIFY(errorSpy.isValid());
ps->requestHideAutoHidingPanel();
QVERIFY(errorSpy.wait());
}
@ -419,7 +400,6 @@ void TestPlasmaShell::testPanelTakesFocus()
// this test verifies that whether a panel wants to take focus is passed through correctly
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
ps->setRole(PlasmaShellSurface::Role::Panel);
@ -448,7 +428,6 @@ void TestPlasmaShell::testDisconnect()
{
// this test verifies that a disconnect cleans up
QSignalSpy plasmaSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(plasmaSurfaceCreatedSpy.isValid());
// create the surface
std::unique_ptr<Surface> s(m_compositor->createSurface());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
@ -461,7 +440,6 @@ void TestPlasmaShell::testDisconnect()
// disconnect
QSignalSpy surfaceDestroyedSpy(sps, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
if (m_connection) {
m_connection->deleteLater();
m_connection = nullptr;
@ -484,7 +462,6 @@ void TestPlasmaShell::testWhileDestroying()
// used for a previous Surface. For each Surface we try to create a PlasmaShellSurface.
// Even if there was a Surface in the past with the same ID, it should create the PlasmaShellSurface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -492,13 +469,11 @@ void TestPlasmaShell::testWhileDestroying()
// create ShellSurface
QSignalSpy shellSurfaceCreatedSpy(m_plasmaShellInterface, &PlasmaShellInterface::surfaceCreated);
QVERIFY(shellSurfaceCreatedSpy.isValid());
std::unique_ptr<PlasmaShellSurface> ps(m_plasmaShell->createSurface(s.get()));
QVERIFY(shellSurfaceCreatedSpy.wait());
// now try to create more surfaces
QSignalSpy clientErrorSpy(m_connection, &ConnectionThread::errorOccurred);
QVERIFY(clientErrorSpy.isValid());
for (int i = 0; i < 100; i++) {
s.reset();
s.reset(m_compositor->createSurface());

View file

@ -75,7 +75,6 @@ void TestPointerConstraints::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -90,9 +89,7 @@ void TestPointerConstraints::init()
Registry registry;
QSignalSpy interfacesAnnouncedSpy(&registry, &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
QSignalSpy interfaceAnnouncedSpy(&registry, &Registry::interfaceAnnounced);
QVERIFY(interfaceAnnouncedSpy.isValid());
registry.setEventQueue(m_queue);
registry.create(m_connection);
QVERIFY(registry.isValid());
@ -114,7 +111,6 @@ void TestPointerConstraints::init()
QVERIFY(m_seat);
QVERIFY(m_seat->isValid());
QSignalSpy pointerChangedSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(pointerChangedSpy.isValid());
QVERIFY(pointerChangedSpy.wait());
m_pointer = m_seat->createPointer(this);
QVERIFY(m_pointer);
@ -168,7 +164,6 @@ void TestPointerConstraints::testLockPointer()
// this test verifies the basic interaction for lock pointer
// first create a surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -180,13 +175,10 @@ void TestPointerConstraints::testLockPointer()
// now create the locked pointer
QSignalSpy pointerConstraintsChangedSpy(serverSurface, &SurfaceInterface::pointerConstraintsChanged);
QVERIFY(pointerConstraintsChangedSpy.isValid());
QFETCH(PointerConstraints::LifeTime, clientLifeTime);
std::unique_ptr<LockedPointer> lockedPointer(m_pointerConstraints->lockPointer(surface.get(), m_pointer, nullptr, clientLifeTime));
QSignalSpy lockedSpy(lockedPointer.get(), &LockedPointer::locked);
QVERIFY(lockedSpy.isValid());
QSignalSpy unlockedSpy(lockedPointer.get(), &LockedPointer::unlocked);
QVERIFY(unlockedSpy.isValid());
QVERIFY(lockedPointer->isValid());
QVERIFY(pointerConstraintsChangedSpy.wait());
@ -204,9 +196,7 @@ void TestPointerConstraints::testLockPointer()
// try setting a region
QSignalSpy destroyedSpy(serverLockedPointer, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
QSignalSpy regionChangedSpy(serverLockedPointer, &LockedPointerV1Interface::regionChanged);
QVERIFY(regionChangedSpy.isValid());
lockedPointer->setRegion(m_compositor->createRegion(QRegion(0, 5, 10, 20), m_compositor));
// it's double buffered
QVERIFY(!regionChangedSpy.wait(500));
@ -221,10 +211,8 @@ void TestPointerConstraints::testLockPointer()
// let's lock the surface
QSignalSpy lockedChangedSpy(serverLockedPointer, &LockedPointerV1Interface::lockedChanged);
QVERIFY(lockedChangedSpy.isValid());
m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0));
QSignalSpy pointerMotionSpy(m_pointer, &Pointer::motion);
QVERIFY(pointerMotionSpy.isValid());
m_seatInterface->notifyPointerMotion(QPoint(0, 1));
m_seatInterface->notifyPointerFrame();
QVERIFY(pointerMotionSpy.wait());
@ -285,7 +273,6 @@ void TestPointerConstraints::testConfinePointer()
// this test verifies the basic interaction for confined pointer
// first create a surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -297,13 +284,10 @@ void TestPointerConstraints::testConfinePointer()
// now create the confined pointer
QSignalSpy pointerConstraintsChangedSpy(serverSurface, &SurfaceInterface::pointerConstraintsChanged);
QVERIFY(pointerConstraintsChangedSpy.isValid());
QFETCH(PointerConstraints::LifeTime, clientLifeTime);
std::unique_ptr<ConfinedPointer> confinedPointer(m_pointerConstraints->confinePointer(surface.get(), m_pointer, nullptr, clientLifeTime));
QSignalSpy confinedSpy(confinedPointer.get(), &ConfinedPointer::confined);
QVERIFY(confinedSpy.isValid());
QSignalSpy unconfinedSpy(confinedPointer.get(), &ConfinedPointer::unconfined);
QVERIFY(unconfinedSpy.isValid());
QVERIFY(confinedPointer->isValid());
QVERIFY(pointerConstraintsChangedSpy.wait());
@ -321,9 +305,7 @@ void TestPointerConstraints::testConfinePointer()
// try setting a region
QSignalSpy destroyedSpy(serverConfinedPointer, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
QSignalSpy regionChangedSpy(serverConfinedPointer, &ConfinedPointerV1Interface::regionChanged);
QVERIFY(regionChangedSpy.isValid());
confinedPointer->setRegion(m_compositor->createRegion(QRegion(0, 5, 10, 20), m_compositor));
// it's double buffered
QVERIFY(!regionChangedSpy.wait(500));
@ -338,7 +320,6 @@ void TestPointerConstraints::testConfinePointer()
// let's confine the surface
QSignalSpy confinedChangedSpy(serverConfinedPointer, &ConfinedPointerV1Interface::confinedChanged);
QVERIFY(confinedChangedSpy.isValid());
m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0));
serverConfinedPointer->setConfined(true);
QCOMPARE(serverConfinedPointer->isConfined(), true);
@ -402,7 +383,6 @@ void TestPointerConstraints::testAlreadyConstrained()
QVERIFY(confinedPointer || lockedPointer);
QSignalSpy errorSpy(m_connection, &ConnectionThread::errorOccurred);
QVERIFY(errorSpy.isValid());
QFETCH(Constraint, secondConstraint);
std::unique_ptr<ConfinedPointer> confinedPointer2;
std::unique_ptr<LockedPointer> lockedPointer2;

View file

@ -196,13 +196,10 @@ void SelectionTest::testClearOnEnter()
{
// this test verifies that the selection is cleared prior to keyboard enter if there is no current selection
QSignalSpy selectionClearedClient1Spy(m_client1.dataDevice, &DataDevice::selectionCleared);
QVERIFY(selectionClearedClient1Spy.isValid());
QSignalSpy keyboardEnteredClient1Spy(m_client1.keyboard, &Keyboard::entered);
QVERIFY(keyboardEnteredClient1Spy.isValid());
// now create a Surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> s1(m_client1.compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface1 = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -220,11 +217,8 @@ void SelectionTest::testClearOnEnter()
// now let's bring in client 2
QSignalSpy selectionOfferedClient2Spy(m_client2.dataDevice, &DataDevice::selectionOffered);
QVERIFY(selectionOfferedClient2Spy.isValid());
QSignalSpy selectionClearedClient2Spy(m_client2.dataDevice, &DataDevice::selectionCleared);
QVERIFY(selectionClearedClient2Spy.isValid());
QSignalSpy keyboardEnteredClient2Spy(m_client2.keyboard, &Keyboard::entered);
QVERIFY(keyboardEnteredClient2Spy.isValid());
std::unique_ptr<Surface> s2(m_client2.compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface2 = surfaceCreatedSpy.last().first().value<SurfaceInterface *>();

View file

@ -66,7 +66,6 @@ void TestServerSideDecoration::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -83,9 +82,7 @@ void TestServerSideDecoration::init()
m_registry = new Registry();
QSignalSpy compositorSpy(m_registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy serverSideDecoManagerSpy(m_registry, &Registry::serverSideDecorationManagerAnnounced);
QVERIFY(serverSideDecoManagerSpy.isValid());
QVERIFY(!m_registry->eventQueue());
m_registry->setEventQueue(m_queue);
@ -158,10 +155,7 @@ void TestServerSideDecoration::testCreate()
QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), serverMode);
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
QSignalSpy decorationCreated(m_serverSideDecorationManagerInterface, &ServerSideDecorationManagerInterface::decorationCreated);
QVERIFY(decorationCreated.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -173,7 +167,6 @@ void TestServerSideDecoration::testCreate()
std::unique_ptr<ServerSideDecoration> serverSideDecoration(m_serverSideDecorationManager->create(surface.get()));
QCOMPARE(serverSideDecoration->mode(), ServerSideDecoration::Mode::None);
QSignalSpy modeChangedSpy(serverSideDecoration.get(), &ServerSideDecoration::modeChanged);
QVERIFY(modeChangedSpy.isValid());
QVERIFY(decorationCreated.wait());
@ -189,7 +182,6 @@ void TestServerSideDecoration::testCreate()
// and destroy
QSignalSpy destroyedSpy(serverDeco, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
serverSideDecoration.reset();
QVERIFY(destroyedSpy.wait());
}
@ -230,23 +222,18 @@ void TestServerSideDecoration::testRequest()
QCOMPARE(m_serverSideDecorationManagerInterface->defaultMode(), defaultMode);
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
QSignalSpy decorationCreated(m_serverSideDecorationManagerInterface, &ServerSideDecorationManagerInterface::decorationCreated);
QVERIFY(decorationCreated.isValid());
// create server side deco
std::unique_ptr<Surface> surface(m_compositor->createSurface());
std::unique_ptr<ServerSideDecoration> serverSideDecoration(m_serverSideDecorationManager->create(surface.get()));
QCOMPARE(serverSideDecoration->mode(), ServerSideDecoration::Mode::None);
QSignalSpy modeChangedSpy(serverSideDecoration.get(), &ServerSideDecoration::modeChanged);
QVERIFY(modeChangedSpy.isValid());
QVERIFY(decorationCreated.wait());
auto serverDeco = decorationCreated.first().first().value<ServerSideDecorationInterface *>();
QVERIFY(serverDeco);
QSignalSpy preferredModeChangedSpy(serverDeco, &ServerSideDecorationInterface::preferredModeChanged);
QVERIFY(preferredModeChangedSpy.isValid());
// after binding the client should get the default mode
QVERIFY(modeChangedSpy.wait());
@ -280,9 +267,7 @@ void TestServerSideDecoration::testSurfaceDestroy()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
QSignalSpy decorationCreated(m_serverSideDecorationManagerInterface, &ServerSideDecorationManagerInterface::decorationCreated);
QVERIFY(decorationCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -296,9 +281,7 @@ void TestServerSideDecoration::testSurfaceDestroy()
// destroy the parent surface
QSignalSpy surfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
QSignalSpy decorationDestroyedSpy(serverDeco, &QObject::destroyed);
QVERIFY(decorationDestroyedSpy.isValid());
surface.reset();
QVERIFY(surfaceDestroyedSpy.wait());
QVERIFY(decorationDestroyedSpy.isEmpty());

View file

@ -68,7 +68,6 @@ void TestServerSideDecorationPalette::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -85,10 +84,8 @@ void TestServerSideDecorationPalette::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy registrySpy(&registry, &Registry::serverSideDecorationPaletteManagerAnnounced);
QVERIFY(registrySpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -137,7 +134,6 @@ void TestServerSideDecorationPalette::cleanup()
void TestServerSideDecorationPalette::testCreateAndSet()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -163,7 +159,6 @@ void TestServerSideDecorationPalette::testCreateAndSet()
// and destroy
QSignalSpy destroyedSpy(paletteInterface, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
delete palette;
QVERIFY(destroyedSpy.wait());
QVERIFY(!m_paletteManagerInterface->paletteForSurface(serverSurface));

View file

@ -62,7 +62,6 @@ void ShadowTest::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -77,7 +76,6 @@ void ShadowTest::init()
Registry registry;
QSignalSpy interfacesAnnouncedSpy(&registry, &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
registry.setEventQueue(m_queue);
registry.create(m_connection);
QVERIFY(registry.isValid());
@ -128,7 +126,6 @@ void ShadowTest::testCreateShadow()
{
// this test verifies the basic shadow behavior, create for surface, commit it, etc.
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -136,7 +133,6 @@ void ShadowTest::testCreateShadow()
// a surface without anything should not have a Shadow
QVERIFY(!serverSurface->shadow());
QSignalSpy shadowChangedSpy(serverSurface, &SurfaceInterface::shadowChanged);
QVERIFY(shadowChangedSpy.isValid());
// let's create a shadow for the Surface
std::unique_ptr<Shadow> shadow(m_shadow->createShadow(surface.get()));
@ -185,13 +181,11 @@ void ShadowTest::testShadowElements()
// this test verifies that all shadow elements are correctly passed to the server
// first create surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface);
QSignalSpy shadowChangedSpy(serverSurface, &SurfaceInterface::shadowChanged);
QVERIFY(shadowChangedSpy.isValid());
// now create the shadow
std::unique_ptr<Shadow> shadow(m_shadow->createShadow(surface.get()));
@ -242,13 +236,11 @@ void ShadowTest::testSurfaceDestroy()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
auto serverSurface = serverSurfaceCreated.first().first().value<SurfaceInterface *>();
QSignalSpy shadowChangedSpy(serverSurface, &SurfaceInterface::shadowChanged);
QVERIFY(shadowChangedSpy.isValid());
std::unique_ptr<Shadow> shadow(m_shadow->createShadow(surface.get()));
shadow->commit();
@ -259,9 +251,7 @@ void ShadowTest::testSurfaceDestroy()
// destroy the parent surface
QSignalSpy surfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
QSignalSpy shadowDestroyedSpy(serverShadow.data(), &QObject::destroyed);
QVERIFY(shadowDestroyedSpy.isValid());
surface.reset();
QVERIFY(surfaceDestroyedSpy.wait());
QVERIFY(shadowDestroyedSpy.isEmpty());

View file

@ -85,7 +85,6 @@ void TextInputTest::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -100,7 +99,6 @@ void TextInputTest::init()
Registry registry;
QSignalSpy interfacesAnnouncedSpy(&registry, &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
registry.setEventQueue(m_queue);
registry.create(m_connection);
QVERIFY(registry.isValid());
@ -110,7 +108,6 @@ void TextInputTest::init()
m_seat = registry.createSeat(registry.interface(Registry::Interface::Seat).name, registry.interface(Registry::Interface::Seat).version, this);
QVERIFY(m_seat->isValid());
QSignalSpy hasKeyboardSpy(m_seat, &Seat::hasKeyboardChanged);
QVERIFY(hasKeyboardSpy.isValid());
QVERIFY(hasKeyboardSpy.wait());
m_keyboard = m_seat->createKeyboard(this);
QVERIFY(m_keyboard->isValid());
@ -193,11 +190,8 @@ void TextInputTest::testEnterLeave()
QVERIFY(serverSurface);
QVERIFY(textInput != nullptr);
QSignalSpy enteredSpy(textInput.get(), &TextInput::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(textInput.get(), &TextInput::left);
QVERIFY(leftSpy.isValid());
QSignalSpy textInputChangedSpy(m_seatInterface, &SeatInterface::focusedTextInputSurfaceChanged);
QVERIFY(textInputChangedSpy.isValid());
// now let's try to enter it
QVERIFY(!m_seatInterface->focusedTextInputSurface());
@ -216,7 +210,6 @@ void TextInputTest::testEnterLeave()
auto serverTextInput = m_seatInterface->textInputV2();
QVERIFY(serverTextInput);
QSignalSpy enabledChangedSpy(serverTextInput, &TextInputV2Interface::enabledChanged);
QVERIFY(enabledChangedSpy.isValid());
if (updatesDirectly) {
QVERIFY(enabledChangedSpy.wait());
enabledChangedSpy.clear();
@ -275,7 +268,6 @@ void TextInputTest::testFocusedBeforeCreateTextInput()
auto serverSurface = waitForSurface();
// now let's try to enter it
QSignalSpy textInputChangedSpy(m_seatInterface, &SeatInterface::focusedTextInputSurfaceChanged);
QVERIFY(textInputChangedSpy.isValid());
QVERIFY(!m_seatInterface->focusedTextInputSurface());
m_seatInterface->setFocusedKeyboardSurface(serverSurface);
QCOMPARE(m_seatInterface->focusedTextInputSurface(), serverSurface);
@ -288,9 +280,7 @@ void TextInputTest::testFocusedBeforeCreateTextInput()
std::unique_ptr<TextInput> textInput(createTextInput());
QVERIFY(textInput != nullptr);
QSignalSpy enteredSpy(textInput.get(), &TextInput::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(textInput.get(), &TextInput::left);
QVERIFY(leftSpy.isValid());
// and trigger an enter
if (enteredSpy.isEmpty()) {
@ -331,11 +321,8 @@ void TextInputTest::testShowHidePanel()
QVERIFY(ti);
QSignalSpy showPanelRequestedSpy(ti, &TextInputV2Interface::requestShowInputPanel);
QVERIFY(showPanelRequestedSpy.isValid());
QSignalSpy hidePanelRequestedSpy(ti, &TextInputV2Interface::requestHideInputPanel);
QVERIFY(hidePanelRequestedSpy.isValid());
QSignalSpy inputPanelStateChangedSpy(textInput.get(), &TextInput::inputPanelStateChanged);
QVERIFY(inputPanelStateChangedSpy.isValid());
QCOMPARE(textInput->isInputPanelVisible(), false);
textInput->showInputPanel();
@ -370,7 +357,6 @@ void TextInputTest::testCursorRectangle()
QVERIFY(ti);
QCOMPARE(ti->cursorRectangle(), QRect());
QSignalSpy cursorRectangleChangedSpy(ti, &TextInputV2Interface::cursorRectangleChanged);
QVERIFY(cursorRectangleChangedSpy.isValid());
textInput->setCursorRectangle(QRect(10, 20, 30, 40));
QVERIFY(cursorRectangleChangedSpy.wait());
@ -396,7 +382,6 @@ void TextInputTest::testPreferredLanguage()
QVERIFY(ti->preferredLanguage().isEmpty());
QSignalSpy preferredLanguageChangedSpy(ti, &TextInputV2Interface::preferredLanguageChanged);
QVERIFY(preferredLanguageChangedSpy.isValid());
textInput->setPreferredLanguage(QStringLiteral("foo"));
QVERIFY(preferredLanguageChangedSpy.wait());
QCOMPARE(ti->preferredLanguage(), QStringLiteral("foo").toUtf8());
@ -420,7 +405,6 @@ void TextInputTest::testReset()
QVERIFY(ti);
QSignalSpy stateUpdatedSpy(ti, &TextInputV2Interface::stateUpdated);
QVERIFY(stateUpdatedSpy.isValid());
textInput->reset();
QVERIFY(stateUpdatedSpy.wait());
@ -447,7 +431,6 @@ void TextInputTest::testSurroundingText()
QCOMPARE(ti->surroundingTextSelectionAnchor(), 0);
QSignalSpy surroundingTextChangedSpy(ti, &TextInputV2Interface::surroundingTextChanged);
QVERIFY(surroundingTextChangedSpy.isValid());
textInput->setSurroundingText(QStringLiteral("100 €, 100 $"), 5, 6);
QVERIFY(surroundingTextChangedSpy.wait());
@ -517,7 +500,6 @@ void TextInputTest::testContentHints()
QCOMPARE(ti->contentHints(), KWaylandServer::TextInputContentHints());
QSignalSpy contentTypeChangedSpy(ti, &TextInputV2Interface::contentTypeChanged);
QVERIFY(contentTypeChangedSpy.isValid());
QFETCH(TextInput::ContentHints, clientHints);
textInput->setContentType(clientHints, TextInput::ContentPurpose::Normal);
QVERIFY(contentTypeChangedSpy.wait());
@ -571,7 +553,6 @@ void TextInputTest::testContentPurpose()
QCOMPARE(ti->contentPurpose(), KWaylandServer::TextInputContentPurpose::Normal);
QSignalSpy contentTypeChangedSpy(ti, &TextInputV2Interface::contentTypeChanged);
QVERIFY(contentTypeChangedSpy.isValid());
QFETCH(TextInput::ContentPurpose, clientPurpose);
textInput->setContentType(TextInput::ContentHints(), clientPurpose);
QVERIFY(contentTypeChangedSpy.wait());
@ -619,7 +600,6 @@ void TextInputTest::testTextDirection()
// let's send the new text direction
QSignalSpy textDirectionChangedSpy(textInput.get(), &TextInput::textDirectionChanged);
QVERIFY(textDirectionChangedSpy.isValid());
QFETCH(Qt::LayoutDirection, textDirection);
ti->setTextDirection(textDirection);
QVERIFY(textDirectionChangedSpy.wait());
@ -655,7 +635,6 @@ void TextInputTest::testLanguage()
// let's send the new language
QSignalSpy langugageChangedSpy(textInput.get(), &TextInput::languageChanged);
QVERIFY(langugageChangedSpy.isValid());
ti->setLanguage(QByteArrayLiteral("foo"));
QVERIFY(langugageChangedSpy.wait());
QCOMPARE(textInput->language(), QByteArrayLiteral("foo"));
@ -689,7 +668,6 @@ void TextInputTest::testKeyEvent()
// TODO: test modifiers
QSignalSpy keyEventSpy(textInput.get(), &TextInput::keyEvent);
QVERIFY(keyEventSpy.isValid());
m_seatInterface->setTimestamp(100);
ti->keysymPressed(2);
QVERIFY(keyEventSpy.wait());
@ -732,7 +710,6 @@ void TextInputTest::testPreEdit()
// now let's pass through some pre-edit events
QSignalSpy composingTextChangedSpy(textInput.get(), &TextInput::composingTextChanged);
QVERIFY(composingTextChangedSpy.isValid());
ti->setPreEditCursor(1);
ti->preEdit(QByteArrayLiteral("foo"), QByteArrayLiteral("bar"));
QVERIFY(composingTextChangedSpy.wait());
@ -776,7 +753,6 @@ void TextInputTest::testCommit()
// now let's commit
QSignalSpy committedSpy(textInput.get(), &TextInput::committed);
QVERIFY(committedSpy.isValid());
ti->setCursorPosition(3, 4);
ti->deleteSurroundingText(2, 1);
ti->commitString(QByteArrayLiteral("foo"));

View file

@ -71,7 +71,6 @@ void TestAppmenu::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -88,10 +87,8 @@ void TestAppmenu::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy appmenuSpy(&registry, &Registry::appMenuAnnounced);
QVERIFY(appmenuSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -139,7 +136,6 @@ void TestAppmenu::cleanup()
void TestAppmenu::testCreateAndSet()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -167,7 +163,6 @@ void TestAppmenu::testCreateAndSet()
// and destroy
QSignalSpy destroyedSpy(appMenuInterface, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
delete appmenu;
QVERIFY(destroyedSpy.wait());
QVERIFY(!m_appmenuManagerInterface->appMenuForSurface(serverSurface));

View file

@ -68,7 +68,6 @@ void TestBlur::init()
// setup connection
m_connection = new KWayland::Client::ConnectionThread;
QSignalSpy connectedSpy(m_connection, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
m_connection->setSocketName(s_socketName);
m_thread = new QThread(this);
@ -85,10 +84,8 @@ void TestBlur::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy blurSpy(&registry, &Registry::blurAnnounced);
QVERIFY(blurSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -137,7 +134,6 @@ void TestBlur::cleanup()
void TestBlur::testCreate()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -155,7 +151,6 @@ void TestBlur::testCreate()
// and destroy
QSignalSpy destroyedSpy(serverSurface->blur().data(), &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
delete blur;
QVERIFY(destroyedSpy.wait());
}
@ -163,14 +158,12 @@ void TestBlur::testCreate()
void TestBlur::testSurfaceDestroy()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
auto serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QSignalSpy blurChanged(serverSurface, &KWaylandServer::SurfaceInterface::blurChanged);
QVERIFY(blurChanged.isValid());
std::unique_ptr<KWayland::Client::Blur> blur(m_blurManager->createBlur(surface.get()));
blur->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr));
@ -182,9 +175,7 @@ void TestBlur::testSurfaceDestroy()
// destroy the parent surface
QSignalSpy surfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
QSignalSpy blurDestroyedSpy(serverSurface->blur().data(), &QObject::destroyed);
QVERIFY(blurDestroyedSpy.isValid());
surface.reset();
QVERIFY(surfaceDestroyedSpy.wait());
QVERIFY(blurDestroyedSpy.isEmpty());

View file

@ -87,10 +87,8 @@ void TestContrast::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy contrastSpy(&registry, &Registry::contrastAnnounced);
QVERIFY(contrastSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -140,7 +138,6 @@ void TestContrast::cleanup()
void TestContrast::testCreate()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -166,7 +163,6 @@ void TestContrast::testCreate()
// and destroy
QSignalSpy destroyedSpy(serverSurface->contrast().data(), &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
delete contrast;
QVERIFY(destroyedSpy.wait());
}
@ -174,14 +170,12 @@ void TestContrast::testCreate()
void TestContrast::testSurfaceDestroy()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
auto serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QSignalSpy contrastChanged(serverSurface, &KWaylandServer::SurfaceInterface::contrastChanged);
QVERIFY(contrastChanged.isValid());
std::unique_ptr<KWayland::Client::Contrast> contrast(m_contrastManager->createContrast(surface.get()));
contrast->setRegion(m_compositor->createRegion(QRegion(0, 0, 10, 20), nullptr));
@ -193,9 +187,7 @@ void TestContrast::testSurfaceDestroy()
// destroy the parent surface
QSignalSpy surfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
QSignalSpy contrastDestroyedSpy(serverSurface->contrast().data(), &QObject::destroyed);
QVERIFY(contrastDestroyedSpy.isValid());
surface.reset();
QVERIFY(surfaceDestroyedSpy.wait());
QVERIFY(contrastDestroyedSpy.isEmpty());

View file

@ -105,7 +105,6 @@ void TestFilter::testFilter()
// setup connection
std::unique_ptr<KWayland::Client::ConnectionThread> connection(new KWayland::Client::ConnectionThread());
QSignalSpy connectedSpy(connection.get(), &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
connection->setSocketName(s_socketName);
std::unique_ptr<QThread> thread(new QThread(this));

View file

@ -115,7 +115,6 @@ void TestWaylandOutput::cleanup()
void TestWaylandOutput::testRegistry()
{
QSignalSpy globalPositionChangedSpy(m_outputInterface.get(), &KWaylandServer::OutputInterface::globalPositionChanged);
QVERIFY(globalPositionChangedSpy.isValid());
QCOMPARE(m_outputInterface->globalPosition(), QPoint(0, 0));
m_outputHandle->moveTo(QPoint(100, 50));
m_outputInterface->setGlobalPosition(QPoint(100, 50));
@ -127,7 +126,6 @@ void TestWaylandOutput::testRegistry()
QCOMPARE(globalPositionChangedSpy.count(), 1);
QSignalSpy physicalSizeChangedSpy(m_outputInterface.get(), &KWaylandServer::OutputInterface::physicalSizeChanged);
QVERIFY(physicalSizeChangedSpy.isValid());
QCOMPARE(m_outputInterface->physicalSize(), QSize());
m_outputHandle->setPhysicalSize(QSize(200, 100));
m_outputInterface->setPhysicalSize(QSize(200, 100));
@ -161,8 +159,6 @@ void TestWaylandOutput::testRegistry()
QCOMPARE(output.transform(), KWayland::Client::Output::Transform::Normal);
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
QVERIFY(outputChanged.isValid());
auto o = registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>());
QVERIFY(!KWayland::Client::Output::get(o));
output.setup(o);
@ -198,9 +194,7 @@ void TestWaylandOutput::testModeChange()
KWayland::Client::Output output;
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
QVERIFY(outputChanged.isValid());
QSignalSpy modeAddedSpy(&output, &KWayland::Client::Output::modeAdded);
QVERIFY(modeAddedSpy.isValid());
output.setup(registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
wl_display_flush(m_connection->display());
QVERIFY(outputChanged.wait());
@ -239,7 +233,6 @@ void TestWaylandOutput::testScaleChange()
KWayland::Client::Output output;
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
QVERIFY(outputChanged.isValid());
output.setup(registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
wl_display_flush(m_connection->display());
QVERIFY(outputChanged.wait());
@ -249,7 +242,6 @@ void TestWaylandOutput::testScaleChange()
outputChanged.clear();
QCOMPARE(m_outputInterface->scale(), 1);
QSignalSpy serverScaleChanged(m_outputInterface.get(), &KWaylandServer::OutputInterface::scaleChanged);
QVERIFY(serverScaleChanged.isValid());
m_outputHandle->setScale(2);
m_outputInterface->setScale(2);
QCOMPARE(m_outputInterface->scale(), 2);
@ -293,7 +285,6 @@ void TestWaylandOutput::testSubPixel()
QFETCH(KWin::Output::SubPixel, actual);
QCOMPARE(m_outputInterface->subPixel(), KWin::Output::SubPixel::Unknown);
QSignalSpy serverSubPixelChangedSpy(m_outputInterface.get(), &KWaylandServer::OutputInterface::subPixelChanged);
QVERIFY(serverSubPixelChangedSpy.isValid());
m_outputHandle->setSubPixel(actual);
m_outputInterface->setSubPixel(actual);
QCOMPARE(m_outputInterface->subPixel(), actual);
@ -313,7 +304,6 @@ void TestWaylandOutput::testSubPixel()
KWayland::Client::Output output;
QSignalSpy outputChanged(&output, &KWayland::Client::Output::changed);
QVERIFY(outputChanged.isValid());
output.setup(registry.bindOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
wl_display_flush(m_connection->display());
if (outputChanged.isEmpty()) {
@ -358,7 +348,6 @@ void TestWaylandOutput::testTransform()
QFETCH(KWin::Output::Transform, actual);
QCOMPARE(m_outputInterface->transform(), KWin::Output::Transform::Normal);
QSignalSpy serverTransformChangedSpy(m_outputInterface.get(), &KWaylandServer::OutputInterface::transformChanged);
QVERIFY(serverTransformChangedSpy.isValid());
m_outputHandle->setTransform(actual);
m_outputInterface->setTransform(actual);
QCOMPARE(m_outputInterface->transform(), actual);
@ -378,7 +367,6 @@ void TestWaylandOutput::testTransform()
KWayland::Client::Output *output = registry.createOutput(announced.first().first().value<quint32>(), announced.first().last().value<quint32>(), &registry);
QSignalSpy outputChanged(output, &KWayland::Client::Output::changed);
QVERIFY(outputChanged.isValid());
wl_display_flush(m_connection->display());
if (outputChanged.isEmpty()) {
QVERIFY(outputChanged.wait());

View file

@ -253,7 +253,6 @@ void TestWaylandSeat::testName()
QCOMPARE(m_seat->name(), QStringLiteral("seat0"));
QSignalSpy spy(m_seat, &KWayland::Client::Seat::nameChanged);
QVERIFY(spy.isValid());
const QString name = QStringLiteral("foobar");
m_seatInterface->setName(name);
@ -290,11 +289,8 @@ void TestWaylandSeat::testCapabilities()
QFETCH(bool, touch);
QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
QSignalSpy keyboardSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged);
QVERIFY(keyboardSpy.isValid());
QSignalSpy touchSpy(m_seat, &KWayland::Client::Seat::hasTouchChanged);
QVERIFY(touchSpy.isValid());
m_seatInterface->setHasPointer(pointer);
m_seatInterface->setHasKeyboard(keyboard);
@ -334,12 +330,10 @@ void TestWaylandSeat::testPointer()
using namespace KWaylandServer;
QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(pointerSpy.wait());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
Surface *s = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -357,7 +351,6 @@ void TestWaylandSeat::testPointer()
Pointer *p = m_seat->createPointer(m_seat);
QSignalSpy frameSpy(p, &Pointer::frame);
QVERIFY(frameSpy.isValid());
const Pointer &cp = *p;
QVERIFY(p->isValid());
std::unique_ptr<RelativePointer> relativePointer(m_relativePointerManager->createRelativePointer(p));
@ -371,22 +364,16 @@ void TestWaylandSeat::testPointer()
QCOMPARE(frameSpy.count(), 2);
QSignalSpy enteredSpy(p, &KWayland::Client::Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(p, &KWayland::Client::Pointer::left);
QVERIFY(leftSpy.isValid());
QSignalSpy motionSpy(p, &KWayland::Client::Pointer::motion);
QVERIFY(motionSpy.isValid());
QSignalSpy axisSpy(p, &KWayland::Client::Pointer::axisChanged);
QVERIFY(axisSpy.isValid());
QSignalSpy buttonSpy(p, &KWayland::Client::Pointer::buttonStateChanged);
QVERIFY(buttonSpy.isValid());
QSignalSpy relativeMotionSpy(relativePointer.get(), &RelativePointer::relativeMotion);
QVERIFY(relativeMotionSpy.isValid());
QVERIFY(!p->enteredSurface());
QVERIFY(!cp.enteredSurface());
@ -542,12 +529,10 @@ void TestWaylandSeat::testPointerTransformation()
using namespace KWaylandServer;
QSignalSpy pointerSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(pointerSpy.wait());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
Surface *s = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -578,13 +563,10 @@ void TestWaylandSeat::testPointerTransformation()
QTest::qWait(100);
QSignalSpy enteredSpy(p, &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(p, &Pointer::left);
QVERIFY(leftSpy.isValid());
QSignalSpy motionSpy(p, &Pointer::motion);
QVERIFY(motionSpy.isValid());
QVERIFY(!p->enteredSurface());
QVERIFY(!cp.enteredSurface());
@ -659,12 +641,10 @@ void TestWaylandSeat::testPointerButton()
using namespace KWaylandServer;
QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(pointerSpy.wait());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
KWayland::Client::Surface *s = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -681,7 +661,6 @@ void TestWaylandSeat::testPointerButton()
std::unique_ptr<Pointer> p(m_seat->createPointer());
QVERIFY(p->isValid());
QSignalSpy buttonChangedSpy(p.get(), &KWayland::Client::Pointer::buttonStateChanged);
QVERIFY(buttonChangedSpy.isValid());
wl_display_flush(m_connection->display());
QCoreApplication::processEvents();
@ -730,7 +709,6 @@ void TestWaylandSeat::testPointerSubSurfaceTree()
// first create the pointer
QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(hasPointerChangedSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(hasPointerChangedSpy.wait());
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
@ -739,7 +717,6 @@ void TestWaylandSeat::testPointerSubSurfaceTree()
// parent surface (100, 100) with one sub surface taking the half of it's size (50, 100)
// which has two further children (50, 50) which are overlapping
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> parentSurface(m_compositor->createSurface());
std::unique_ptr<Surface> childSurface(m_compositor->createSurface());
std::unique_ptr<Surface> grandChild1Surface(m_compositor->createSurface());
@ -768,11 +745,8 @@ void TestWaylandSeat::testPointerSubSurfaceTree()
// send in pointer events
QSignalSpy enteredSpy(pointer.get(), &Pointer::entered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(pointer.get(), &Pointer::left);
QVERIFY(leftSpy.isValid());
QSignalSpy motionSpy(pointer.get(), &Pointer::motion);
QVERIFY(motionSpy.isValid());
// first to the grandChild2 in the overlapped area
quint32 timestamp = 1;
m_seatInterface->setTimestamp(timestamp++);
@ -837,7 +811,6 @@ void TestWaylandSeat::testPointerSwipeGesture()
// first create the pointer and pointer swipe gesture
QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(hasPointerChangedSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(hasPointerChangedSpy.wait());
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
@ -848,17 +821,12 @@ void TestWaylandSeat::testPointerSwipeGesture()
QCOMPARE(gesture->fingerCount(), 0u);
QSignalSpy startSpy(gesture.get(), &PointerSwipeGesture::started);
QVERIFY(startSpy.isValid());
QSignalSpy updateSpy(gesture.get(), &PointerSwipeGesture::updated);
QVERIFY(updateSpy.isValid());
QSignalSpy endSpy(gesture.get(), &PointerSwipeGesture::ended);
QVERIFY(endSpy.isValid());
QSignalSpy cancelledSpy(gesture.get(), &PointerSwipeGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
// now create a surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -962,7 +930,6 @@ void TestWaylandSeat::testPointerPinchGesture()
// first create the pointer and pointer swipe gesture
QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(hasPointerChangedSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(hasPointerChangedSpy.wait());
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
@ -973,17 +940,12 @@ void TestWaylandSeat::testPointerPinchGesture()
QCOMPARE(gesture->fingerCount(), 0u);
QSignalSpy startSpy(gesture.get(), &PointerPinchGesture::started);
QVERIFY(startSpy.isValid());
QSignalSpy updateSpy(gesture.get(), &PointerPinchGesture::updated);
QVERIFY(updateSpy.isValid());
QSignalSpy endSpy(gesture.get(), &PointerPinchGesture::ended);
QVERIFY(endSpy.isValid());
QSignalSpy cancelledSpy(gesture.get(), &PointerPinchGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
// now create a surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -1110,13 +1072,11 @@ void TestWaylandSeat::testPointerHoldGesture()
// first create the pointer and pointer swipe gesture
QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(hasPointerChangedSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(hasPointerChangedSpy.wait());
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
Registry registry;
QSignalSpy gesturesAnnoucedSpy(&registry, &Registry::pointerGesturesUnstableV1Announced);
QVERIFY(gesturesAnnoucedSpy.isValid());
registry.create(m_connection);
registry.setup();
QVERIFY(gesturesAnnoucedSpy.wait());
@ -1125,15 +1085,11 @@ void TestWaylandSeat::testPointerHoldGesture()
QVERIFY(gesture.isInitialized());
QSignalSpy startSpy(&gesture, &PointerHoldGesture::started);
QVERIFY(startSpy.isValid());
QSignalSpy endSpy(&gesture, &PointerHoldGesture::ended);
QVERIFY(endSpy.isValid());
QSignalSpy cancelledSpy(&gesture, &PointerHoldGesture::cancelled);
QVERIFY(cancelledSpy.isValid());
// now create a surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -1206,7 +1162,6 @@ void TestWaylandSeat::testPointerAxis()
// first create the pointer
QSignalSpy hasPointerChangedSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(hasPointerChangedSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(hasPointerChangedSpy.wait());
std::unique_ptr<Pointer> pointer(m_seat->createPointer());
@ -1214,7 +1169,6 @@ void TestWaylandSeat::testPointerAxis()
// now create a surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
@ -1231,19 +1185,14 @@ void TestWaylandSeat::testPointerAxis()
m_seatInterface->notifyPointerEnter(serverSurface, QPointF(0, 0));
QCOMPARE(m_seatInterface->focusedPointerSurface(), serverSurface);
QSignalSpy frameSpy(pointer.get(), &Pointer::frame);
QVERIFY(frameSpy.isValid());
QVERIFY(frameSpy.wait());
QCOMPARE(frameSpy.count(), 1);
// let's scroll vertically
QSignalSpy axisSourceSpy(pointer.get(), &Pointer::axisSourceChanged);
QVERIFY(axisSourceSpy.isValid());
QSignalSpy axisSpy(pointer.get(), &Pointer::axisChanged);
QVERIFY(axisSpy.isValid());
QSignalSpy axisDiscreteSpy(pointer.get(), &Pointer::axisDiscreteChanged);
QVERIFY(axisDiscreteSpy.isValid());
QSignalSpy axisStoppedSpy(pointer.get(), &Pointer::axisStopped);
QVERIFY(axisStoppedSpy.isValid());
quint32 timestamp = 1;
m_seatInterface->setTimestamp(timestamp++);
@ -1314,12 +1263,10 @@ void TestWaylandSeat::testCursor()
using namespace KWaylandServer;
QSignalSpy pointerSpy(m_seat, &KWayland::Client::Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(pointerSpy.wait());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
KWayland::Client::Surface *surface = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -1339,7 +1286,6 @@ void TestWaylandSeat::testCursor()
QCoreApplication::processEvents();
QSignalSpy enteredSpy(p.get(), &KWayland::Client::Pointer::entered);
QVERIFY(enteredSpy.isValid());
m_seatInterface->notifyPointerEnter(serverSurface, QPointF(20, 18), QPointF(10, 15));
quint32 serial = m_seatInterface->display()->serial();
@ -1349,7 +1295,6 @@ void TestWaylandSeat::testCursor()
QVERIFY(!m_seatInterface->pointer()->cursor());
QSignalSpy cursorChangedSpy(m_seatInterface->pointer(), &KWaylandServer::PointerInterface::cursorChanged);
QVERIFY(cursorChangedSpy.isValid());
// just remove the pointer
p->setCursor(nullptr);
QVERIFY(cursorChangedSpy.wait());
@ -1362,13 +1307,9 @@ void TestWaylandSeat::testCursor()
QCOMPARE(cursor->pointer(), m_seatInterface->pointer());
QSignalSpy hotspotChangedSpy(cursor, &KWaylandServer::Cursor::hotspotChanged);
QVERIFY(hotspotChangedSpy.isValid());
QSignalSpy surfaceChangedSpy(cursor, &KWaylandServer::Cursor::surfaceChanged);
QVERIFY(surfaceChangedSpy.isValid());
QSignalSpy enteredSerialChangedSpy(cursor, &KWaylandServer::Cursor::enteredSerialChanged);
QVERIFY(enteredSerialChangedSpy.isValid());
QSignalSpy changedSpy(cursor, &KWaylandServer::Cursor::changed);
QVERIFY(changedSpy.isValid());
// test changing hotspot
p->setCursor(nullptr, QPoint(1, 2));
@ -1430,7 +1371,6 @@ void TestWaylandSeat::testCursorDamage()
using namespace KWaylandServer;
QSignalSpy pointerSpy(m_seat, &Seat::hasPointerChanged);
QVERIFY(pointerSpy.isValid());
m_seatInterface->setHasPointer(true);
QVERIFY(pointerSpy.wait());
@ -1438,10 +1378,8 @@ void TestWaylandSeat::testCursorDamage()
std::unique_ptr<Pointer> p(m_seat->createPointer());
QVERIFY(p->isValid());
QSignalSpy enteredSpy(p.get(), &Pointer::entered);
QVERIFY(enteredSpy.isValid());
// create surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
KWayland::Client::Surface *surface = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -1462,7 +1400,6 @@ void TestWaylandSeat::testCursorDamage()
// create a signal spy for the cursor changed signal
auto pointer = m_seatInterface->pointer();
QSignalSpy cursorChangedSpy(pointer, &PointerInterface::cursorChanged);
QVERIFY(cursorChangedSpy.isValid());
// now let's set the cursor
Surface *cursorSurface = m_compositor->createSurface(m_compositor);
@ -1492,7 +1429,6 @@ void TestWaylandSeat::testKeyboard()
using namespace KWaylandServer;
QSignalSpy keyboardSpy(m_seat, &KWayland::Client::Seat::hasKeyboardChanged);
QVERIFY(keyboardSpy.isValid());
m_seatInterface->setHasKeyboard(true);
QVERIFY(keyboardSpy.wait());
@ -1501,7 +1437,6 @@ void TestWaylandSeat::testKeyboard()
// create the surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
Surface *s = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -1509,7 +1444,6 @@ void TestWaylandSeat::testKeyboard()
Keyboard *keyboard = m_seat->createKeyboard(m_seat);
QSignalSpy repeatInfoSpy(keyboard, &Keyboard::keyRepeatChanged);
QVERIFY(repeatInfoSpy.isValid());
const Keyboard &ckeyboard = *keyboard;
QVERIFY(keyboard->isValid());
QCOMPARE(keyboard->isKeyRepeatEnabled(), false);
@ -1543,10 +1477,8 @@ void TestWaylandSeat::testKeyboard()
m_seatInterface->notifyKeyboardKey(KEY_E, KeyboardKeyState::Pressed);
QSignalSpy modifierSpy(keyboard, &KWayland::Client::Keyboard::modifiersChanged);
QVERIFY(modifierSpy.isValid());
QSignalSpy enteredSpy(keyboard, &KWayland::Client::Keyboard::entered);
QVERIFY(enteredSpy.isValid());
m_seatInterface->setFocusedKeyboardSurface(serverSurface);
QCOMPARE(m_seatInterface->focusedKeyboardSurface(), serverSurface);
QCOMPARE(m_seatInterface->keyboard()->focusedSurface(), serverSurface);
@ -1563,7 +1495,6 @@ void TestWaylandSeat::testKeyboard()
QCOMPARE(enteredSpy.first().first().value<quint32>(), m_display->serial() - 1);
QSignalSpy keyChangedSpy(keyboard, &KWayland::Client::Keyboard::keyChanged);
QVERIFY(keyChangedSpy.isValid());
m_seatInterface->setTimestamp(4);
m_seatInterface->notifyKeyboardKey(KEY_E, KeyboardKeyState::Released);
@ -1622,7 +1553,6 @@ void TestWaylandSeat::testKeyboard()
QCOMPARE(modifierSpy.last().at(3).value<quint32>(), quint32(4));
QSignalSpy leftSpy(keyboard, &KWayland::Client::Keyboard::left);
QVERIFY(leftSpy.isValid());
m_seatInterface->setFocusedKeyboardSurface(nullptr);
QVERIFY(!m_seatInterface->focusedKeyboardSurface());
QVERIFY(leftSpy.wait());
@ -1644,7 +1574,6 @@ void TestWaylandSeat::testKeyboard()
QCOMPARE(ckeyboard.enteredSurface(), s);
QSignalSpy serverSurfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(serverSurfaceDestroyedSpy.isValid());
QCOMPARE(keyboard->enteredSurface(), s);
delete s;
QVERIFY(!keyboard->enteredSurface());
@ -1671,7 +1600,6 @@ void TestWaylandSeat::testSelection()
std::unique_ptr<DataDeviceManagerInterface> ddmi(new DataDeviceManagerInterface(m_display));
Registry registry;
QSignalSpy dataDeviceManagerSpy(&registry, &KWayland::Client::Registry::dataDeviceManagerAnnounced);
QVERIFY(dataDeviceManagerSpy.isValid());
m_seatInterface->setHasKeyboard(true);
registry.setEventQueue(m_queue);
registry.create(m_connection->display());
@ -1686,12 +1614,9 @@ void TestWaylandSeat::testSelection()
std::unique_ptr<DataDevice> dd1(ddm->getDataDevice(m_seat));
QVERIFY(dd1->isValid());
QSignalSpy selectionSpy(dd1.get(), &KWayland::Client::DataDevice::selectionOffered);
QVERIFY(selectionSpy.isValid());
QSignalSpy selectionClearedSpy(dd1.get(), &KWayland::Client::DataDevice::selectionCleared);
QVERIFY(selectionClearedSpy.isValid());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -1766,7 +1691,6 @@ void TestWaylandSeat::testSelection()
dd2->setSelection(0, ds2.get());
QVERIFY(selectionSpy.wait());
QSignalSpy cancelledSpy(ds2.get(), &DataSource::cancelled);
QVERIFY(cancelledSpy.isValid());
m_seatInterface->setSelection(ddi);
QVERIFY(cancelledSpy.wait());
}
@ -1781,13 +1705,11 @@ void TestWaylandSeat::testDataDeviceForKeyboardSurface()
// create the DataDeviceManager
std::unique_ptr<DataDeviceManagerInterface> ddmi(new DataDeviceManagerInterface(m_display));
QSignalSpy ddiCreatedSpy(ddmi.get(), &DataDeviceManagerInterface::dataDeviceCreated);
QVERIFY(ddiCreatedSpy.isValid());
m_seatInterface->setHasKeyboard(true);
// create a second Wayland client connection to use it for setSelection
auto c = new ConnectionThread;
QSignalSpy connectedSpy(c, &ConnectionThread::connected);
QVERIFY(connectedSpy.isValid());
c->setSocketName(s_socketName);
auto thread = new QThread(this);
@ -1802,7 +1724,6 @@ void TestWaylandSeat::testDataDeviceForKeyboardSurface()
std::unique_ptr<Registry> registry(new Registry);
QSignalSpy interfacesAnnouncedSpy(registry.get(), &Registry::interfacesAnnounced);
QVERIFY(interfacesAnnouncedSpy.isValid());
registry->setEventQueue(queue.get());
registry->create(c);
QVERIFY(registry->isValid());
@ -1826,7 +1747,6 @@ void TestWaylandSeat::testDataDeviceForKeyboardSurface()
// switch to other client
// create a surface and pass it keyboard focus
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -1837,7 +1757,6 @@ void TestWaylandSeat::testDataDeviceForKeyboardSurface()
// now create a DataDevice
Registry registry2;
QSignalSpy dataDeviceManagerSpy(&registry2, &Registry::dataDeviceManagerAnnounced);
QVERIFY(dataDeviceManagerSpy.isValid());
registry2.setEventQueue(m_queue);
registry2.create(m_connection->display());
QVERIFY(registry2.isValid());
@ -1874,13 +1793,11 @@ void TestWaylandSeat::testTouch()
using namespace KWaylandServer;
QSignalSpy touchSpy(m_seat, &KWayland::Client::Seat::hasTouchChanged);
QVERIFY(touchSpy.isValid());
m_seatInterface->setHasTouch(true);
QVERIFY(touchSpy.wait());
// create the surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
Surface *s = m_compositor->createSurface(m_compositor);
QVERIFY(surfaceCreatedSpy.wait());
SurfaceInterface *serverSurface = surfaceCreatedSpy.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -1898,19 +1815,12 @@ void TestWaylandSeat::testTouch()
QCoreApplication::processEvents();
QSignalSpy sequenceStartedSpy(touch, &KWayland::Client::Touch::sequenceStarted);
QVERIFY(sequenceStartedSpy.isValid());
QSignalSpy sequenceEndedSpy(touch, &KWayland::Client::Touch::sequenceEnded);
QVERIFY(sequenceEndedSpy.isValid());
QSignalSpy sequenceCanceledSpy(touch, &KWayland::Client::Touch::sequenceCanceled);
QVERIFY(sequenceCanceledSpy.isValid());
QSignalSpy frameEndedSpy(touch, &KWayland::Client::Touch::frameEnded);
QVERIFY(frameEndedSpy.isValid());
QSignalSpy pointAddedSpy(touch, &KWayland::Client::Touch::pointAdded);
QVERIFY(pointAddedSpy.isValid());
QSignalSpy pointMovedSpy(touch, &KWayland::Client::Touch::pointMoved);
QVERIFY(pointMovedSpy.isValid());
QSignalSpy pointRemovedSpy(touch, &KWayland::Client::Touch::pointRemoved);
QVERIFY(pointRemovedSpy.isValid());
// try a few things
m_seatInterface->setFocusedTouchSurfacePosition(QPointF(10, 20));
@ -2062,14 +1972,12 @@ void TestWaylandSeat::testKeymap()
m_seatInterface->setHasKeyboard(true);
QSignalSpy keyboardChangedSpy(m_seat, &Seat::hasKeyboardChanged);
QVERIFY(keyboardChangedSpy.isValid());
QVERIFY(keyboardChangedSpy.wait());
std::unique_ptr<Keyboard> keyboard(m_seat->createKeyboard());
// create surface
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surface->isValid());
QVERIFY(surfaceCreatedSpy.wait());
@ -2078,7 +1986,6 @@ void TestWaylandSeat::testKeymap()
m_seatInterface->setFocusedKeyboardSurface(serverSurface);
QSignalSpy keymapChangedSpy(keyboard.get(), &Keyboard::keymapChanged);
QVERIFY(keymapChangedSpy.isValid());
m_seatInterface->keyboard()->setKeymap(QByteArrayLiteral("foo"));
QVERIFY(keymapChangedSpy.wait());

View file

@ -84,10 +84,8 @@ void TestSlide::init()
Registry registry;
QSignalSpy compositorSpy(&registry, &Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy slideSpy(&registry, &Registry::slideAnnounced);
QVERIFY(slideSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
@ -136,8 +134,6 @@ void TestSlide::cleanup()
void TestSlide::testCreate()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
@ -156,7 +152,6 @@ void TestSlide::testCreate()
// and destroy
QSignalSpy destroyedSpy(serverSurface->slideOnShowHide().data(), &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
delete slide;
QVERIFY(destroyedSpy.wait());
}
@ -165,14 +160,11 @@ void TestSlide::testSurfaceDestroy()
{
using namespace KWaylandServer;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> surface(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
auto serverSurface = serverSurfaceCreated.first().first().value<SurfaceInterface *>();
QSignalSpy slideChanged(serverSurface, &SurfaceInterface::slideOnShowHideChanged);
QVERIFY(slideChanged.isValid());
std::unique_ptr<Slide> slide(m_slideManager->createSlide(surface.get()));
slide->commit();
@ -183,9 +175,7 @@ void TestSlide::testSurfaceDestroy()
// destroy the parent surface
QSignalSpy surfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
QSignalSpy slideDestroyedSpy(serverSlide.data(), &QObject::destroyed);
QVERIFY(slideDestroyedSpy.isValid());
surface.reset();
QVERIFY(surfaceDestroyedSpy.wait());
QVERIFY(slideDestroyedSpy.isEmpty());

View file

@ -107,9 +107,7 @@ void TestSubSurface::init()
KWayland::Client::Registry registry;
QSignalSpy compositorSpy(&registry, &KWayland::Client::Registry::compositorAnnounced);
QVERIFY(compositorSpy.isValid());
QSignalSpy subCompositorSpy(&registry, &KWayland::Client::Registry::subCompositorAnnounced);
QVERIFY(subCompositorSpy.isValid());
QVERIFY(!registry.eventQueue());
registry.setEventQueue(m_queue);
QCOMPARE(registry.eventQueue(), m_queue);
@ -171,7 +169,6 @@ void TestSubSurface::testCreate()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
// create two Surfaces
std::unique_ptr<Surface> surface(m_compositor->createSurface());
@ -186,7 +183,6 @@ void TestSubSurface::testCreate()
QVERIFY(serverParentSurface);
QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated);
QVERIFY(subSurfaceCreatedSpy.isValid());
// create subSurface for surface of parent
std::unique_ptr<SubSurface> subSurface(m_subCompositor->createSubSurface(QPointer<Surface>(surface.get()), QPointer<Surface>(parent.get())));
@ -213,7 +209,6 @@ void TestSubSurface::testCreate()
// and let's destroy it again
QSignalSpy destroyedSpy(serverSubSurface, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
subSurface.reset();
QVERIFY(destroyedSpy.wait());
QCOMPARE(serverSurface->subSurface(), QPointer<SubSurfaceInterface>());
@ -242,7 +237,6 @@ void TestSubSurface::testMode()
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated);
QVERIFY(subSurfaceCreatedSpy.isValid());
// create the SubSurface for surface of parent
std::unique_ptr<SubSurface> subSurface(m_subCompositor->createSubSurface(QPointer<Surface>(surface.get()), QPointer<Surface>(parent.get())));
@ -256,7 +250,6 @@ void TestSubSurface::testMode()
// verify that we can change to desynchronized
QSignalSpy modeChangedSpy(serverSubSurface, &KWaylandServer::SubSurfaceInterface::modeChanged);
QVERIFY(modeChangedSpy.isValid());
subSurface->setMode(SubSurface::Mode::Desynchronized);
QCOMPARE(subSurface->mode(), SubSurface::Mode::Desynchronized);
@ -298,7 +291,6 @@ void TestSubSurface::testPosition()
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated);
QVERIFY(subSurfaceCreatedSpy.isValid());
// create the SubSurface for surface of parent
std::unique_ptr<SubSurface> subSurface(m_subCompositor->createSubSurface(QPointer<Surface>(surface.get()), QPointer<Surface>(parent.get())));
@ -315,7 +307,6 @@ void TestSubSurface::testPosition()
QCOMPARE(serverSubSurface->position(), QPoint());
QSignalSpy positionChangedSpy(serverSubSurface, &KWaylandServer::SubSurfaceInterface::positionChanged);
QVERIFY(positionChangedSpy.isValid());
// changing the position should not trigger a direct update on server side
subSurface->setPosition(QPoint(10, 20));
@ -334,7 +325,6 @@ void TestSubSurface::testPosition()
// committing the parent surface should update the position
QSignalSpy parentCommittedSpy(serverSubSurface->parentSurface(), &SurfaceInterface::committed);
QVERIFY(parentCommittedSpy.isValid());
parent->commit(Surface::CommitFlag::None);
QVERIFY(parentCommittedSpy.wait());
QCOMPARE(positionChangedSpy.count(), 1);
@ -353,7 +343,6 @@ void TestSubSurface::testPlaceAbove()
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated);
QVERIFY(subSurfaceCreatedSpy.isValid());
// create the SubSurfaces for surface of parent
std::unique_ptr<SubSurface> subSurface1(m_subCompositor->createSubSurface(QPointer<Surface>(surface1.get()), QPointer<Surface>(parent.get())));
@ -456,7 +445,6 @@ void TestSubSurface::testPlaceBelow()
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QSignalSpy subSurfaceCreatedSpy(m_subcompositorInterface, &KWaylandServer::SubCompositorInterface::subSurfaceCreated);
QVERIFY(subSurfaceCreatedSpy.isValid());
// create the SubSurfaces for surface of parent
std::unique_ptr<SubSurface> subSurface1(m_subCompositor->createSubSurface(QPointer<Surface>(surface1.get()), QPointer<Surface>(parent.get())));
@ -559,7 +547,6 @@ void TestSubSurface::testSyncMode()
using namespace KWaylandServer;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
@ -575,7 +562,6 @@ void TestSubSurface::testSyncMode()
// let's damage the child surface
QSignalSpy childDamagedSpy(childSurface, &SurfaceInterface::damaged);
QVERIFY(childDamagedSpy.isValid());
QImage image(QSize(200, 200), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::black);
@ -602,7 +588,6 @@ void TestSubSurface::testSyncMode()
// sending frame rendered to parent should also send it to child
QSignalSpy frameRenderedSpy(surface.get(), &Surface::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
parentSurface->frameRendered(100);
QVERIFY(frameRenderedSpy.wait());
}
@ -614,7 +599,6 @@ void TestSubSurface::testDeSyncMode()
using namespace KWaylandServer;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> surface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
@ -630,7 +614,6 @@ void TestSubSurface::testDeSyncMode()
// let's damage the child surface
QSignalSpy childDamagedSpy(childSurface, &SurfaceInterface::damaged);
QVERIFY(childDamagedSpy.isValid());
QImage image(QSize(200, 200), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::black);
@ -663,7 +646,6 @@ void TestSubSurface::testMainSurfaceFromTree()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> parentSurface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
@ -687,7 +669,6 @@ void TestSubSurface::testMainSurfaceFromTree()
m_subCompositor->createSubSurface(childLevel3Surface.get(), childLevel2Surface.get());
QSignalSpy parentCommittedSpy(parentServerSurface, &SurfaceInterface::committed);
QVERIFY(parentCommittedSpy.isValid());
parentSurface->commit(Surface::CommitFlag::None);
QVERIFY(parentCommittedSpy.wait());
@ -717,7 +698,6 @@ void TestSubSurface::testRemoveSurface()
using namespace KWaylandServer;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> parentSurface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
@ -729,7 +709,6 @@ void TestSubSurface::testRemoveSurface()
QVERIFY(childServerSurface);
QSignalSpy childrenChangedSpy(parentServerSurface, &SurfaceInterface::childSubSurfacesChanged);
QVERIFY(childrenChangedSpy.isValid());
m_subCompositor->createSubSurface(childSurface.get(), parentSurface.get());
parentSurface->commit(Surface::CommitFlag::None);
@ -751,7 +730,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
std::unique_ptr<Surface> parentSurface(m_compositor->createSurface());
QVERIFY(surfaceCreatedSpy.wait());
@ -775,7 +753,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
auto subSurfaceLevel3 = m_subCompositor->createSubSurface(childLevel3Surface.get(), childLevel2Surface.get());
QSignalSpy parentCommittedSpy(parentServerSurface, &SurfaceInterface::committed);
QVERIFY(parentCommittedSpy.isValid());
parentSurface->commit(Surface::CommitFlag::None);
QVERIFY(parentCommittedSpy.wait());
@ -806,7 +783,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
// first map the child, should not map it
QSignalSpy child3DamageSpy(child3->surface(), &SurfaceInterface::damaged);
QVERIFY(child3DamageSpy.isValid());
QImage image(QSize(200, 200), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::black);
childLevel3Surface->attachBuffer(m_shm->createBuffer(image));
@ -818,7 +794,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
// let's map the top level
QSignalSpy parentSpy(parentServerSurface, &SurfaceInterface::damaged);
QVERIFY(parentSpy.isValid());
parentSurface->attachBuffer(m_shm->createBuffer(image));
parentSurface->damage(QRect(0, 0, 200, 200));
parentSurface->commit(Surface::CommitFlag::None);
@ -831,7 +806,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
// next level
QSignalSpy child2DamageSpy(child2->surface(), &SurfaceInterface::damaged);
QVERIFY(child2DamageSpy.isValid());
childLevel2Surface->attachBuffer(m_shm->createBuffer(image));
childLevel2Surface->damage(QRect(0, 0, 200, 200));
childLevel2Surface->commit(Surface::CommitFlag::None);
@ -844,7 +818,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
// last but not least the first child level, which should map all our subsurfaces
QSignalSpy child1DamageSpy(child->surface(), &SurfaceInterface::damaged);
QVERIFY(child1DamageSpy.isValid());
childLevel1Surface->attachBuffer(m_shm->createBuffer(image));
childLevel1Surface->damage(QRect(0, 0, 200, 200));
childLevel1Surface->commit(Surface::CommitFlag::None);
@ -858,7 +831,6 @@ void TestSubSurface::testMappingOfSurfaceTree()
// unmapping a parent should unmap the complete tree
QSignalSpy unmappedSpy(child->surface(), &SurfaceInterface::unmapped);
QVERIFY(unmappedSpy.isValid());
childLevel1Surface->attachBuffer(Buffer::Ptr());
childLevel1Surface->damage(QRect(0, 0, 200, 200));
childLevel1Surface->commit(Surface::CommitFlag::None);
@ -877,7 +849,6 @@ void TestSubSurface::testSurfaceAt()
using namespace KWaylandServer;
// first create a parent surface and map it
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::red);
@ -949,7 +920,6 @@ void TestSubSurface::testSurfaceAt()
partImage.fill(Qt::blue);
QSignalSpy childFor2CommittedSpy(childFor2ServerSurface, &SurfaceInterface::committed);
QVERIFY(childFor2CommittedSpy.isValid());
childFor2->attachBuffer(m_shm->createBuffer(partImage));
// child for 2's input region is subdivided into quadrants, with input mask on the top left and bottom right
QRegion region;
@ -1002,7 +972,6 @@ void TestSubSurface::testDestroyAttachedBuffer()
using namespace KWaylandServer;
// create surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
std::unique_ptr<Surface> child(m_compositor->createSurface());
@ -1021,7 +990,6 @@ void TestSubSurface::testDestroyAttachedBuffer()
// Let's try to destroy it
QSignalSpy destroySpy(serverChildSurface, &QObject::destroyed);
QVERIFY(destroySpy.isValid());
delete m_shm;
m_shm = nullptr;
child.reset();
@ -1036,7 +1004,6 @@ void TestSubSurface::testDestroyParentSurface()
using namespace KWaylandServer;
// create surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> parent(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverParentSurface = serverSurfaceCreated.last().first().value<KWaylandServer::SurfaceInterface *>();
@ -1056,7 +1023,6 @@ void TestSubSurface::testDestroyParentSurface()
// and at the same time delete the parent surface
parent.reset();
QSignalSpy parentDestroyedSpy(serverParentSurface, &QObject::destroyed);
QVERIFY(parentDestroyedSpy.isValid());
QVERIFY(parentDestroyedSpy.wait());
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::red);
@ -1064,12 +1030,10 @@ void TestSubSurface::testDestroyParentSurface()
grandChild->damage(QRect(0, 0, 100, 100));
grandChild->commit(Surface::CommitFlag::None);
QSignalSpy damagedSpy(serverGrandChildSurface, &SurfaceInterface::damaged);
QVERIFY(damagedSpy.isValid());
QVERIFY(damagedSpy.wait());
// Let's try to destroy it
QSignalSpy destroySpy(serverChildSurface, &QObject::destroyed);
QVERIFY(destroySpy.isValid());
child.reset();
QVERIFY(destroySpy.wait());
}

View file

@ -127,8 +127,6 @@ void TestWaylandSurface::init()
QSignalSpy compositorSpy(&registry, &KWayland::Client::Registry::compositorAnnounced);
QSignalSpy shmSpy(&registry, &KWayland::Client::Registry::shmAnnounced);
QSignalSpy allAnnounced(&registry, &KWayland::Client::Registry::interfacesAnnounced);
QVERIFY(allAnnounced.isValid());
QVERIFY(shmSpy.isValid());
registry.create(m_connection->display());
QVERIFY(registry.isValid());
registry.setup();
@ -185,7 +183,6 @@ void TestWaylandSurface::cleanup()
void TestWaylandSurface::testStaticAccessor()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
QVERIFY(!KWaylandServer::SurfaceInterface::get(nullptr));
QVERIFY(!KWaylandServer::SurfaceInterface::get(1, nullptr));
@ -203,7 +200,6 @@ void TestWaylandSurface::testStaticAccessor()
QVERIFY(!s1->size().isValid());
QSignalSpy sizeChangedSpy(s1.get(), &KWayland::Client::Surface::sizeChanged);
QVERIFY(sizeChangedSpy.isValid());
const QSize testSize(200, 300);
s1->setSize(testSize);
QCOMPARE(s1->size(), testSize);
@ -241,7 +237,6 @@ void TestWaylandSurface::testStaticAccessor()
QVERIFY(KWayland::Client::Surface::all().isEmpty());
QVERIFY(!KWayland::Client::Surface::get(nullptr));
QSignalSpy destroyedSpy(serverSurface1, &KWaylandServer::SurfaceInterface::destroyed);
QVERIFY(destroyedSpy.isValid());
QVERIFY(destroyedSpy.wait());
QVERIFY(!KWaylandServer::SurfaceInterface::get(nullptr));
QVERIFY(!KWaylandServer::SurfaceInterface::get(surfaceId1, nullptr));
@ -251,7 +246,6 @@ void TestWaylandSurface::testStaticAccessor()
void TestWaylandSurface::testDamage()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> s(m_compositor->createSurface());
s->setScale(2);
QVERIFY(serverSurfaceCreated.wait());
@ -262,7 +256,6 @@ void TestWaylandSurface::testDamage()
QSignalSpy committedSpy(serverSurface, &KWaylandServer::SurfaceInterface::committed);
QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged);
QVERIFY(damageSpy.isValid());
// send damage without a buffer
s->damage(QRect(0, 0, 100, 100));
@ -340,17 +333,14 @@ void TestWaylandSurface::testDamage()
void TestWaylandSurface::testFrameCallback()
{
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QVERIFY(serverSurface);
QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged);
QVERIFY(damageSpy.isValid());
QSignalSpy frameRenderedSpy(s.get(), &KWayland::Client::Surface::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied);
img.fill(Qt::black);
auto b = m_shm->createBuffer(img);
@ -368,7 +358,6 @@ void TestWaylandSurface::testAttachBuffer()
{
// create the surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<KWayland::Client::Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
KWaylandServer::SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -401,11 +390,8 @@ void TestWaylandSurface::testAttachBuffer()
s->damage(QRect(0, 0, 24, 24));
s->commit(KWayland::Client::Surface::CommitFlag::None);
QSignalSpy damageSpy(serverSurface, &KWaylandServer::SurfaceInterface::damaged);
QVERIFY(damageSpy.isValid());
QSignalSpy mappedSpy(serverSurface, &KWaylandServer::SurfaceInterface::mapped);
QVERIFY(mappedSpy.isValid());
QSignalSpy unmappedSpy(serverSurface, &KWaylandServer::SurfaceInterface::unmapped);
QVERIFY(unmappedSpy.isValid());
QVERIFY(damageSpy.wait());
QCOMPARE(mappedSpy.count(), 1);
QVERIFY(unmappedSpy.isEmpty());
@ -449,7 +435,6 @@ void TestWaylandSurface::testAttachBuffer()
s->attachBuffer(blueBuffer.data());
s->damage(QRect(0, 0, 24, 24));
QSignalSpy frameRenderedSpy(s.get(), &KWayland::Client::Surface::frameRendered);
QVERIFY(frameRenderedSpy.isValid());
s->commit();
damageSpy.clear();
QVERIFY(damageSpy.wait());
@ -533,7 +518,6 @@ void TestWaylandSurface::testMultipleSurfaces()
// create the surfaces
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s1(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface1 = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -558,7 +542,6 @@ void TestWaylandSurface::testMultipleSurfaces()
s1->damage(QRect(0, 0, 24, 24));
s1->commit(Surface::CommitFlag::None);
QSignalSpy damageSpy1(serverSurface1, &KWaylandServer::SurfaceInterface::damaged);
QVERIFY(damageSpy1.isValid());
QVERIFY(damageSpy1.wait());
// now the ServerSurface should have the black image attached as a buffer
@ -579,7 +562,6 @@ void TestWaylandSurface::testMultipleSurfaces()
s2->damage(QRect(0, 0, 24, 24));
s2->commit(Surface::CommitFlag::None);
QSignalSpy damageSpy2(serverSurface2, &KWaylandServer::SurfaceInterface::damaged);
QVERIFY(damageSpy2.isValid());
QVERIFY(damageSpy2.wait());
ClientBuffer *buffer2 = serverSurface2->buffer();
@ -609,13 +591,11 @@ void TestWaylandSurface::testOpaque()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QVERIFY(serverSurface);
QSignalSpy opaqueRegionChangedSpy(serverSurface, &KWaylandServer::SurfaceInterface::opaqueChanged);
QVERIFY(opaqueRegionChangedSpy.isValid());
// by default there should be an empty opaque region
QCOMPARE(serverSurface->opaque(), QRegion());
@ -668,15 +648,12 @@ void TestWaylandSurface::testInput()
using namespace KWayland::Client;
using namespace KWaylandServer;
QSignalSpy serverSurfaceCreated(m_compositorInterface, &KWaylandServer::CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QVERIFY(serverSurface);
QSignalSpy inputRegionChangedSpy(serverSurface, &KWaylandServer::SurfaceInterface::inputChanged);
QVERIFY(inputRegionChangedSpy.isValid());
QSignalSpy committedSpy(serverSurface, &SurfaceInterface::committed);
QVERIFY(committedSpy.isValid());
// the input region should be empty if the surface has no buffer
QVERIFY(!serverSurface->isMapped());
@ -737,7 +714,6 @@ void TestWaylandSurface::testScale()
using namespace KWaylandServer;
// create surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QCOMPARE(s->scale(), 1);
QVERIFY(serverSurfaceCreated.wait());
@ -751,7 +727,6 @@ void TestWaylandSurface::testScale()
// changing the scale implicitly changes the size
QSignalSpy sizeChangedSpy(serverSurface, &SurfaceInterface::sizeChanged);
QVERIFY(bufferScaleChangedSpy.isValid());
s->setScale(2);
QCOMPARE(s->scale(), 2);
// needs a commit
@ -829,13 +804,11 @@ void TestWaylandSurface::testUnmapOfNotMappedSurface()
using namespace KWaylandServer;
// create surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
QSignalSpy unmappedSpy(serverSurface, &SurfaceInterface::unmapped);
QVERIFY(unmappedSpy.isValid());
QSignalSpy bufferScaleChanged(serverSurface, &SurfaceInterface::bufferScaleChanged);
// let's map a null buffer and change scale to trigger a signal we can wait for
@ -854,7 +827,6 @@ void TestWaylandSurface::testSurfaceAt()
using namespace KWaylandServer;
// create surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
@ -865,7 +837,6 @@ void TestWaylandSurface::testSurfaceAt()
// let's damage this surface
QSignalSpy sizeChangedSpy(serverSurface, &SurfaceInterface::sizeChanged);
QVERIFY(sizeChangedSpy.isValid());
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::red);
s->attachBuffer(m_shm->createBuffer(image));
@ -889,14 +860,12 @@ void TestWaylandSurface::testDestroyAttachedBuffer()
using namespace KWaylandServer;
// create surface
QSignalSpy serverSurfaceCreated(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(serverSurfaceCreated.isValid());
std::unique_ptr<Surface> s(m_compositor->createSurface());
QVERIFY(serverSurfaceCreated.wait());
SurfaceInterface *serverSurface = serverSurfaceCreated.first().first().value<KWaylandServer::SurfaceInterface *>();
// let's damage this surface
QSignalSpy damagedSpy(serverSurface, &SurfaceInterface::damaged);
QVERIFY(damagedSpy.isValid());
QImage image(QSize(100, 100), QImage::Format_ARGB32_Premultiplied);
image.fill(Qt::red);
s->attachBuffer(m_shm->createBuffer(image));
@ -926,7 +895,6 @@ void TestWaylandSurface::testDestroyWithPendingCallback()
QVERIFY(s != nullptr);
QVERIFY(s->isValid());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface);
@ -943,12 +911,10 @@ void TestWaylandSurface::testDestroyWithPendingCallback()
}
s->commit(KWayland::Client::Surface::CommitFlag::FrameCallback);
QSignalSpy damagedSpy(serverSurface, &SurfaceInterface::damaged);
QVERIFY(damagedSpy.isValid());
QVERIFY(damagedSpy.wait());
// now try to destroy the Surface again
QSignalSpy destroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(destroyedSpy.isValid());
s.reset();
QVERIFY(destroyedSpy.wait());
}
@ -962,16 +928,13 @@ void TestWaylandSurface::testDisconnect()
QVERIFY(s != nullptr);
QVERIFY(s->isValid());
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface);
// destroy client
QSignalSpy clientDisconnectedSpy(serverSurface->client(), &ClientConnection::disconnected);
QVERIFY(clientDisconnectedSpy.isValid());
QSignalSpy surfaceDestroyedSpy(serverSurface, &QObject::destroyed);
QVERIFY(surfaceDestroyedSpy.isValid());
if (m_connection) {
m_connection->deleteLater();
m_connection = nullptr;
@ -1001,12 +964,9 @@ void TestWaylandSurface::testOutput()
QVERIFY(s->isValid());
QVERIFY(s->outputs().isEmpty());
QSignalSpy enteredSpy(s.get(), &Surface::outputEntered);
QVERIFY(enteredSpy.isValid());
QSignalSpy leftSpy(s.get(), &Surface::outputLeft);
QVERIFY(leftSpy.isValid());
// wait for the surface on the Server side
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface);
@ -1016,13 +976,11 @@ void TestWaylandSurface::testOutput()
Registry registry;
registry.setEventQueue(m_queue);
QSignalSpy allAnnounced(&registry, &Registry::interfacesAnnounced);
QVERIFY(allAnnounced.isValid());
registry.create(m_connection);
QVERIFY(registry.isValid());
registry.setup();
QVERIFY(allAnnounced.wait());
QSignalSpy outputAnnouncedSpy(&registry, &Registry::outputAnnounced);
QVERIFY(outputAnnouncedSpy.isValid());
auto outputHandle = std::make_unique<FakeOutput>();
auto serverOutput = std::make_unique<OutputInterface>(m_display, outputHandle.get());
@ -1078,14 +1036,12 @@ void TestWaylandSurface::testInhibit()
std::unique_ptr<Surface> s(m_compositor->createSurface());
// wait for the surface on the Server side
QSignalSpy surfaceCreatedSpy(m_compositorInterface, &CompositorInterface::surfaceCreated);
QVERIFY(surfaceCreatedSpy.isValid());
QVERIFY(surfaceCreatedSpy.wait());
auto serverSurface = surfaceCreatedSpy.first().first().value<SurfaceInterface *>();
QVERIFY(serverSurface);
QCOMPARE(serverSurface->inhibitsIdle(), false);
QSignalSpy inhibitsChangedSpy(serverSurface, &SurfaceInterface::inhibitsIdleChanged);
QVERIFY(inhibitsChangedSpy.isValid());
// now create an idle inhibition
std::unique_ptr<IdleInhibitor> inhibitor1(m_idleInhibitManager->createInhibitor(s.get()));

Some files were not shown because too many files have changed in this diff Show more