tests: cover GameCenter unique DBus service behavior

This commit is contained in:
Marco Allegretti 2026-02-14 13:07:51 +01:00
parent d4e0326974
commit 57d1e6e130

View file

@ -79,6 +79,7 @@ private Q_SLOTS:
void cleanupTestCase();
void pingGameCenter();
void gameCenterUniqueness();
void pingRunner();
void pingInput();
void runnerResolveLaunchNative();
@ -243,6 +244,34 @@ void DbusSmokeTest::pingGameCenter()
QCOMPARE(reply.value(), QStringLiteral("ok"));
}
void DbusSmokeTest::gameCenterUniqueness()
{
pingGameCenter();
QVERIFY(m_bus.interface());
const QDBusReply<QString> ownerBeforeReply = m_bus.interface()->serviceOwner(QStringLiteral("org.kde.GameCenter1"));
QVERIFY(ownerBeforeReply.isValid());
const QString ownerBefore = ownerBeforeReply.value();
QVERIFY(!ownerBefore.isEmpty());
QProcess second;
startDaemon(second, m_gamecenterPath);
QVERIFY(second.waitForStarted(5000));
const bool finished = second.waitForFinished(5000);
if (!finished) {
stopProcess(second);
}
QVERIFY(finished);
QCOMPARE(second.exitStatus(), QProcess::NormalExit);
const QDBusReply<QString> ownerAfterReply = m_bus.interface()->serviceOwner(QStringLiteral("org.kde.GameCenter1"));
QVERIFY(ownerAfterReply.isValid());
QCOMPARE(ownerAfterReply.value(), ownerBefore);
pingGameCenter();
}
void DbusSmokeTest::pingRunner()
{
QDBusInterface iface(QStringLiteral("org.kde.ALaKarte.Runner1"),