on xenial help sign in
Fix some tests that broke with new manual login pre-req
669c2afMichael Terry
plugins/LightDM/Greeter.cpp+1
@@ -160,6 +160,7 @@ void Greeter::authenticate(const QString &username)
160 d->m_greeter->authenticate(username);
160 d->m_greeter->authenticate(username);
161 }
161 }
162
162
163+ Q_EMIT authenticationStarted();
163 Q_EMIT isAuthenticatedChanged();
164 Q_EMIT isAuthenticatedChanged();
164 checkAuthenticationUser();
165 checkAuthenticationUser();
165}
166}
plugins/LightDM/Greeter.h+1
@@ -68,6 +68,7 @@ Q_SIGNALS:
68 void hideGreeter();
68 void hideGreeter();
69 void loginError(bool automatic);
69 void loginError(bool automatic);
70 void loginSuccess(bool automatic);
70 void loginSuccess(bool automatic);
71+ void authenticationStarted(); // useful for testing
71
72
72 // This signal is emitted by external agents like indicators, and the UI
73 // This signal is emitted by external agents like indicators, and the UI
73 // should switch to this user if possible.
74 // should switch to this user if possible.
tests/qmltests/Greeter/tst_Greeter.qml+9−9
@@ -76,9 +76,9 @@ Item {
76 }
76 }
77
77
78 SignalSpy {
78 SignalSpy {
79− id: authUserChangedSpy
79+ id: authStartedSpy
80 target: LightDM.Greeter
80 target: LightDM.Greeter
81− signalName: "authenticationUserChanged"
81+ signalName: "authenticationStarted"
82 }
82 }
83
83
84 GSettings {
84 GSettings {
@@ -155,7 +155,7 @@ Item {
155 viewForceShowSpy.clear();
155 viewForceShowSpy.clear();
156 viewTryToUnlockSpy.clear();
156 viewTryToUnlockSpy.clear();
157 resetLoader();
157 resetLoader();
158− authUserChangedSpy.clear();
158+ authStartedSpy.clear();
159 }
159 }
160
160
161 function resetLoader() {
161 function resetLoader() {
@@ -223,12 +223,12 @@ Item {
223
223
224 function test_unlockFail() {
224 function test_unlockFail() {
225 selectUser("has-password");
225 selectUser("has-password");
226− tryCompare(authUserChangedSpy, "count", 1);
226+ tryCompare(authStartedSpy, "count", 1);
227
227
228 view.responded("wr0ng p4ssw0rd");
228 view.responded("wr0ng p4ssw0rd");
229 tryCompare(viewAuthenticationFailedSpy, "count", 1);
229 tryCompare(viewAuthenticationFailedSpy, "count", 1);
230
230
231− tryCompare(authUserChangedSpy, "count", 2);
231+ tryCompare(authStartedSpy, "count", 2);
232 }
232 }
233
233
234 function test_promptless() {
234 function test_promptless() {
@@ -246,23 +246,23 @@ Item {
246
246
247 function test_twoFactorFailOnFirst() {
247 function test_twoFactorFailOnFirst() {
248 selectUser("two-factor");
248 selectUser("two-factor");
249− tryCompare(authUserChangedSpy, "count", 1);
249+ tryCompare(authStartedSpy, "count", 1);
250
250
251 view.responded("wr0ng p4ssw0rd");
251 view.responded("wr0ng p4ssw0rd");
252 tryCompare(viewAuthenticationFailedSpy, "count", 1);
252 tryCompare(viewAuthenticationFailedSpy, "count", 1);
253
253
254− tryCompare(authUserChangedSpy, "count", 2);
254+ tryCompare(authStartedSpy, "count", 2);
255 }
255 }
256
256
257 function test_twoFactorFailOnSecond() {
257 function test_twoFactorFailOnSecond() {
258 selectUser("two-factor");
258 selectUser("two-factor");
259− tryCompare(authUserChangedSpy, "count", 1);
259+ tryCompare(authStartedSpy, "count", 1);
260
260
261 view.responded("password");
261 view.responded("password");
262 view.responded("wr0ng p4ssw0rd");
262 view.responded("wr0ng p4ssw0rd");
263 tryCompare(viewAuthenticationFailedSpy, "count", 1);
263 tryCompare(viewAuthenticationFailedSpy, "count", 1);
264
264
265− tryCompare(authUserChangedSpy, "count", 2);
265+ tryCompare(authStartedSpy, "count", 2);
266 }
266 }
267
267
268 function test_locked() {
268 function test_locked() {
tests/qmltests/tst_Shell.qml+1
@@ -1497,6 +1497,7 @@ Rectangle {
1497 typeString("has-password");
1497 typeString("has-password");
1498 keyClick(Qt.Key_Enter);
1498 keyClick(Qt.Key_Enter);
1499
1499
1500+ promptHint = findChild(greeter, "promptHint");
1500 tryCompare(username, "text", "has-password");
1501 tryCompare(username, "text", "has-password");
1501 tryCompare(promptHint, "text", "Passphrase");
1502 tryCompare(promptHint, "text", "Passphrase");
1502
1503