on xenial help sign in
Fix some tests that broke with new manual login pre-req
commit669c2afb0c60bd82e0d40cc087dc1c3ce9013c66 authorMichael Terry <mike@mterry.name> dateThu 19 Jan 2017, 12:52 (10 years ago) parent9a8a24c
4 files changed+12−9
plugins/LightDM/Greeter.cpp+1 plugins/LightDM/Greeter.h+1 tests/qmltests/Greeter/tst_Greeter.qml+9−9 tests/qmltests/tst_Shell.qml+1
plugins/LightDM/Greeter.cpp+1
@@ -160,6 +160,7 @@ void Greeter::authenticate(const QString &username)
160160 d->m_greeter->authenticate(username);
161161 }
162162
163+ Q_EMIT authenticationStarted();
163164 Q_EMIT isAuthenticatedChanged();
164165 checkAuthenticationUser();
165166}
plugins/LightDM/Greeter.h+1
@@ -68,6 +68,7 @@ Q_SIGNALS:
6868 void hideGreeter();
6969 void loginError(bool automatic);
7070 void loginSuccess(bool automatic);
71+ void authenticationStarted(); // useful for testing
7172
7273 // This signal is emitted by external agents like indicators, and the UI
7374 // should switch to this user if possible.
tests/qmltests/Greeter/tst_Greeter.qml+9−9
@@ -76,9 +76,9 @@ Item {
7676 }
7777
7878 SignalSpy {
79− id: authUserChangedSpy
79+ id: authStartedSpy
8080 target: LightDM.Greeter
81− signalName: "authenticationUserChanged"
81+ signalName: "authenticationStarted"
8282 }
8383
8484 GSettings {
@@ -155,7 +155,7 @@ Item {
155155 viewForceShowSpy.clear();
156156 viewTryToUnlockSpy.clear();
157157 resetLoader();
158− authUserChangedSpy.clear();
158+ authStartedSpy.clear();
159159 }
160160
161161 function resetLoader() {
@@ -223,12 +223,12 @@ Item {
223223
224224 function test_unlockFail() {
225225 selectUser("has-password");
226− tryCompare(authUserChangedSpy, "count", 1);
226+ tryCompare(authStartedSpy, "count", 1);
227227
228228 view.responded("wr0ng p4ssw0rd");
229229 tryCompare(viewAuthenticationFailedSpy, "count", 1);
230230
231− tryCompare(authUserChangedSpy, "count", 2);
231+ tryCompare(authStartedSpy, "count", 2);
232232 }
233233
234234 function test_promptless() {
@@ -246,23 +246,23 @@ Item {
246246
247247 function test_twoFactorFailOnFirst() {
248248 selectUser("two-factor");
249− tryCompare(authUserChangedSpy, "count", 1);
249+ tryCompare(authStartedSpy, "count", 1);
250250
251251 view.responded("wr0ng p4ssw0rd");
252252 tryCompare(viewAuthenticationFailedSpy, "count", 1);
253253
254− tryCompare(authUserChangedSpy, "count", 2);
254+ tryCompare(authStartedSpy, "count", 2);
255255 }
256256
257257 function test_twoFactorFailOnSecond() {
258258 selectUser("two-factor");
259− tryCompare(authUserChangedSpy, "count", 1);
259+ tryCompare(authStartedSpy, "count", 1);
260260
261261 view.responded("password");
262262 view.responded("wr0ng p4ssw0rd");
263263 tryCompare(viewAuthenticationFailedSpy, "count", 1);
264264
265− tryCompare(authUserChangedSpy, "count", 2);
265+ tryCompare(authStartedSpy, "count", 2);
266266 }
267267
268268 function test_locked() {
tests/qmltests/tst_Shell.qml+1
@@ -1497,6 +1497,7 @@ Rectangle {
14971497 typeString("has-password");
14981498 keyClick(Qt.Key_Enter);
14991499
1500+ promptHint = findChild(greeter, "promptHint");
15001501 tryCompare(username, "text", "has-password");
15011502 tryCompare(promptHint, "text", "Passphrase");
15021503