mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-03-26 17:03:08 +00:00
tests: cover GameCenter unique DBus service behavior
This commit is contained in:
parent
d4e0326974
commit
57d1e6e130
1 changed files with 29 additions and 0 deletions
|
|
@ -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"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue