~mzanetti/unity8/fix-left-edge-on-spread

« back to all changes in this revision

Viewing changes to tests/plugins/LightDM/dbus.cpp

  • Committer: Michael Zanetti
  • Date: 2015-01-12 11:21:17 UTC
  • mfrom: (1459.1.85 unity8)
  • Revision ID: michael.zanetti@canonical.com-20150112112117-0x9srs9dx0ndp60g
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
#include "Greeter.h"
18
18
 
 
19
#include <QCoreApplication>
19
20
#include <QDBusInterface>
20
21
#include <QDBusReply>
21
22
#include <QSignalSpy>
149
150
        QVERIFY(dbusList->property("EntryIsLocked").toBool());
150
151
 
151
152
        greeter->authenticate("no-password");
 
153
        QCoreApplication::processEvents(); // wait for auth to finish
152
154
        QVERIFY(!dbusList->property("EntryIsLocked").toBool());
153
155
 
154
156
        greeter->authenticate("has-password");
 
157
        QCoreApplication::processEvents(); // wait for auth to finish
155
158
        QVERIFY(dbusList->property("EntryIsLocked").toBool());
156
159
    }
157
160
 
159
162
    {
160
163
        QSignalSpy spy(this, SIGNAL(PropertiesChangedRelay(QString, QVariantMap, QStringList)));
161
164
        greeter->authenticate("no-password");
 
165
 
 
166
        // Two property changed signals will be emitted, one for the IsLocked
 
167
        // property, one for the ActiveEntry; the first will be IsLocked.
162
168
        spy.wait();
 
169
        if (spy.count() < 2) {
 
170
            spy.wait();
 
171
        }
 
172
        QCOMPARE(spy.count(), 2);
163
173
 
164
 
        QCOMPARE(spy.count(), 2); // once for locked, once for user; first will be locked mode
165
 
        QList<QVariant> arguments = spy.takeFirst();
 
174
        QList<QVariant> arguments = spy.takeLast();
166
175
        QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
167
176
        QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
168
177
        QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);