on xenial help sign in
Remerge lp:~mterry/unity8/cleanup-greeter-dbus-test
5c12379Michał Sawicz
tests/plugins/LightDM/dbus.cpp+5−2
@@ -163,10 +163,13 @@ private Q_SLOTS:
163 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
163 QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
164 greeter->authenticate("no-password");
164 greeter->authenticate("no-password");
165
165
166− // once for user, once for locked; second will be for locked mode
166+ // Two property changed signals will be emitted, one for the IsLocked
167+ // property, one for the ActiveEntry; the first will be IsLocked.
168+ spy.wait();
167− while (spy.count() != 2) {
169+ if (spy.count() < 2) {
168 spy.wait();
170 spy.wait();
169 }
171 }
172+ QCOMPARE(spy.count(), 2);
170
173
171 QList<QVariant> arguments = spy.takeLast();
174 QList<QVariant> arguments = spy.takeLast();
172 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
175 QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");