@@ -16,6 +16,7 @@
17#include "Greeter.h"
17#include "Greeter.h"
19+#include <QCoreApplication>
19#include <QDBusInterface>
20#include <QDBusInterface>
20#include <QDBusReply>
21#include <QDBusReply>
21#include <QSignalSpy>
22#include <QSignalSpy>
@@ -149,9 +150,11 @@ private Q_SLOTS:
149 QVERIFY(dbusList->property("EntryIsLocked").toBool());
150 QVERIFY(dbusList->property("EntryIsLocked").toBool());
151 greeter->authenticate("no-password");
152 greeter->authenticate("no-password");
153+ QCoreApplication::processEvents(); // wait for auth to finish
152 QVERIFY(!dbusList->property("EntryIsLocked").toBool());
154 QVERIFY(!dbusList->property("EntryIsLocked").toBool());
154 greeter->authenticate("has-password");
156 greeter->authenticate("has-password");
157+ QCoreApplication::processEvents(); // wait for auth to finish
155 QVERIFY(dbusList->property("EntryIsLocked").toBool());
158 QVERIFY(dbusList->property("EntryIsLocked").toBool());
@@ -161,8 +164,8 @@ private Q_SLOTS:
161 greeter->authenticate("no-password");
164 greeter->authenticate("no-password");
162 spy.wait();
165 spy.wait();
164− QCOMPARE(spy.count(), 2); // once for locked, once for user; first will be locked mode
167+ QCOMPARE(spy.count(), 2); // once for user, once for locked; second will be for locked mode
165− QList<QVariant> arguments = spy.takeFirst();
168+ QList<QVariant> arguments = spy.takeLast();
166 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
169 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
167 QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
170 QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
168 QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);
171 QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);