From 563e3724406de11d3bf41158e5af4a79310883b3 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 22 Mar 2022 13:28:18 +0200 Subject: [PATCH] autotests: Fix DBusInterfaceTest with KWIN_BUILD_ACTIVITIES=OFF X11-specific code path was overlooked in 79a4733dc5351ad5d8abf59fb3fbe8e7452a6832. --- autotests/integration/dbus_interface_test.cpp | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/autotests/integration/dbus_interface_test.cpp b/autotests/integration/dbus_interface_test.cpp index cefd9d6cce..e44201a4d1 100644 --- a/autotests/integration/dbus_interface_test.cpp +++ b/autotests/integration/dbus_interface_test.cpp @@ -261,39 +261,44 @@ void TestDbusInterface::testGetWindowInfoX11Client() QCOMPARE(client->window(), w); QCOMPARE(client->clientSize(), windowGeometry.size()); + const QVariantMap expectedData { + { QStringLiteral("type"), NET::Normal }, + { QStringLiteral("x"), client->x() }, + { QStringLiteral("y"), client->y() }, + { QStringLiteral("width"), client->width() }, + { QStringLiteral("height"), client->height() }, + { QStringLiteral("desktops"), client->desktopIds() }, + { QStringLiteral("minimized"), false }, + { QStringLiteral("shaded"), false }, + { QStringLiteral("fullscreen"), false }, + { QStringLiteral("keepAbove"), false }, + { QStringLiteral("keepBelow"), false }, + { QStringLiteral("skipTaskbar"), false }, + { QStringLiteral("skipPager"), false }, + { QStringLiteral("skipSwitcher"), false }, + { QStringLiteral("maximizeHorizontal"), false }, + { QStringLiteral("maximizeVertical"), false }, + { QStringLiteral("noBorder"), false }, + { QStringLiteral("role"), QString() }, + { QStringLiteral("resourceName"), QStringLiteral("foo") }, + { QStringLiteral("resourceClass"), QStringLiteral("bar") }, + { QStringLiteral("desktopFile"), QStringLiteral("org.kde.foo") }, + { QStringLiteral("caption"), QStringLiteral("Some caption") }, +#if KWIN_BUILD_ACTIVITIES + { QStringLiteral("activities"), QStringList() }, +#endif + }; + // let's get the window info QDBusPendingReply reply{getWindowInfo(client->internalId())}; reply.waitForFinished(); QVERIFY(reply.isValid()); QVERIFY(!reply.isError()); auto windowData = reply.value(); - QVERIFY(!windowData.isEmpty()); - QCOMPARE(windowData.size(), 25); - QCOMPARE(windowData.value(QStringLiteral("type")).toInt(), NET::Normal); - QCOMPARE(windowData.value(QStringLiteral("x")).toInt(), client->x()); - QCOMPARE(windowData.value(QStringLiteral("y")).toInt(), client->y()); - QCOMPARE(windowData.value(QStringLiteral("width")).toInt(), client->width()); - QCOMPARE(windowData.value(QStringLiteral("height")).toInt(), client->height()); - QCOMPARE(windowData.value(QStringLiteral("desktops")).toStringList(), client->desktopIds()); - QCOMPARE(windowData.value(QStringLiteral("minimized")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("shaded")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("fullscreen")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("keepAbove")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("keepBelow")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("skipTaskbar")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("skipPager")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("skipSwitcher")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("maximizeHorizontal")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("maximizeVertical")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("noBorder")).toBool(), false); - QCOMPARE(windowData.value(QStringLiteral("role")).toString(), QString()); - QCOMPARE(windowData.value(QStringLiteral("resourceName")).toString(), QStringLiteral("foo")); - QCOMPARE(windowData.value(QStringLiteral("resourceClass")).toString(), QStringLiteral("bar")); - QCOMPARE(windowData.value(QStringLiteral("desktopFile")).toString(), QStringLiteral("org.kde.foo")); - QCOMPARE(windowData.value(QStringLiteral("caption")).toString(), QStringLiteral("Some caption")); - QCOMPARE(windowData.value(QStringLiteral("activities")), QStringList()); - // not testing clientmachine as that is system dependent - // due to that also not testing localhost + // not testing clientmachine as that is system dependent due to that also not testing localhost + windowData.remove(QStringLiteral("clientMachine")); + windowData.remove(QStringLiteral("localhost")); + QCOMPARE(windowData, expectedData); auto verifyProperty = [client] (const QString &name) { QDBusPendingReply reply{getWindowInfo(client->internalId())};