@@ -134,14 +134,12 @@ private Q_SLOTS:
134 QCoreApplication::processEvents(); // to let the service register on DBus
134 QCoreApplication::processEvents(); // to let the service register on DBus
136 QDBusInterface accIface("org.freedesktop.Accounts", "/org/freedesktop/Accounts", "org.freedesktop.Accounts", QDBusConnection::systemBus());
136 QDBusInterface accIface("org.freedesktop.Accounts", "/org/freedesktop/Accounts", "org.freedesktop.Accounts", QDBusConnection::systemBus());
137− QVERIFY(accIface.isValid());
137+ QTRY_VERIFY(accIface.isValid());
138 QDBusReply<QDBusObjectPath> userPath = accIface.asyncCall("FindUserById", static_cast<qint64>(geteuid()));
138 QDBusReply<QDBusObjectPath> userPath = accIface.asyncCall("FindUserById", static_cast<qint64>(geteuid()));
139− if (!userPath.isValid()) {
139+ if (userPath.isValid()) {
140− QFAIL("Could not get user path in Account Service");
140+ QDBusInterface userAccIface("org.freedesktop.Accounts", userPath.value().path(), "org.freedesktop.Accounts.User", QDBusConnection::systemBus());
141+ QTRY_COMPARE(dbusUnitySessionService.RealName(), userAccIface.property("RealName").toString());
143− QDBusInterface userAccIface("org.freedesktop.Accounts", userPath.value().path(), "org.freedesktop.Accounts.User", QDBusConnection::systemBus());
144− QCOMPARE(dbusUnitySessionService.RealName(), userAccIface.property("RealName").toString());
147 void testLogin1Capabilities() {
145 void testLogin1Capabilities() {