on xenial help sign in
Fix dbus test
commit2c52eb1559b9fa5fb3c48b7d73fef659382dfb4d authorMichael Terry <michael.terry@canonical.com> dateThu 11 Dec 2014, 09:29 (12 years ago) parente742456
1 file changed+5−2
tests/plugins/LightDM/dbus.cpp+5−2
tests/plugins/LightDM/dbus.cpp+5−2
@@ -16,6 +16,7 @@
1616
1717#include "Greeter.h"
1818
19+#include <QCoreApplication>
1920#include <QDBusInterface>
2021#include <QDBusReply>
2122#include <QSignalSpy>
@@ -149,9 +150,11 @@ private Q_SLOTS:
149150 QVERIFY(dbusList->property("EntryIsLocked").toBool());
150151
151152 greeter->authenticate("no-password");
153+ QCoreApplication::processEvents(); // wait for auth to finish
152154 QVERIFY(!dbusList->property("EntryIsLocked").toBool());
153155
154156 greeter->authenticate("has-password");
157+ QCoreApplication::processEvents(); // wait for auth to finish
155158 QVERIFY(dbusList->property("EntryIsLocked").toBool());
156159 }
157160
@@ -161,8 +164,8 @@ private Q_SLOTS:
161164 greeter->authenticate("no-password");
162165 spy.wait();
163166
164− QCOMPARE(spy.count(), 2); // once for locked, once for user; first will be locked mode
165− QList<QVariant> arguments = spy.takeFirst();
167+ QCOMPARE(spy.count(), 2); // once for user, once for locked; second will be for locked mode
168+ QList<QVariant> arguments = spy.takeLast();
166169 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
167170 QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
168171 QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);