diff --git a/tests/dbus_smoketest.cpp b/tests/dbus_smoketest.cpp index b3aaaa6..c45e92c 100644 --- a/tests/dbus_smoketest.cpp +++ b/tests/dbus_smoketest.cpp @@ -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 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 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"),