@@ -160,10 +160,13 @@ private Q_SLOTS:
160 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
160 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
161 greeter->authenticate("no-password");
161 greeter->authenticate("no-password");
163− // once for locked, once for user; first will be locked mode
163+ // Two property changed signals will be emitted, one for the IsLocked
164+ // property, one for the ActiveEntry; the first will be IsLocked.
164− while (spy.count() != 2) {
166+ if (spy.count() < 2) {
165 spy.wait();
167 spy.wait();
169+ QCOMPARE(spy.count(), 2);
168 QList<QVariant> arguments = spy.takeFirst();
171 QList<QVariant> arguments = spy.takeFirst();
169 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
172 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");