~aacid/unity8/autoOpenSubMenus

« back to all changes in this revision

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

Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
    void cleanup()
83
83
    {
84
84
        delete view;
 
85
        delete greeter; // reset singleton
85
86
    }
86
87
 
87
88
    void testGetActiveEntry()
137
138
    {
138
139
        QSignalSpy spy(this, &GreeterDBusTest::PropertiesChangedRelay);
139
140
        greeter->authenticate("has-password");
140
 
        spy.wait();
141
 
 
142
 
        QVERIFY(spy.count() > 0);
143
 
        QList<QVariant> arguments = spy.takeFirst();
 
141
 
 
142
        QTRY_COMPARE(spy.count(), 2); // EntryIsLocked then ActiveEntry
 
143
 
 
144
        QList<QVariant> arguments = spy[1];
144
145
        QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
145
146
        QVERIFY(arguments.at(1).toMap().contains("ActiveEntry"));
146
147
        QVERIFY(arguments.at(1).toMap()["ActiveEntry"] == "has-password");
162
163
        QSignalSpy spy(this, &GreeterDBusTest::PropertiesChangedRelay);
163
164
        greeter->authenticate("no-password");
164
165
 
165
 
        // Two property changed signals will be emitted, one for the IsLocked
166
 
        // property, one for the ActiveEntry; the first will be IsLocked.
167
 
        spy.wait();
168
 
        if (spy.count() < 2) {
169
 
            spy.wait();
170
 
        }
171
 
        QCOMPARE(spy.count(), 2);
 
166
        // EntryIsLocked=true, ActiveEntry, then EntryIsLocked=false
 
167
        QTRY_COMPARE(spy.count(), 3);
172
168
 
173
 
        QList<QVariant> arguments = spy.takeLast();
 
169
        QList<QVariant> arguments = spy[2];
174
170
        QVERIFY(arguments.at(0).toString() == "com.canonical.UnityGreeter.List");
175
171
        QVERIFY(arguments.at(1).toMap().contains("EntryIsLocked"));
176
172
        QVERIFY(arguments.at(1).toMap()["EntryIsLocked"] == false);