@@ -176,15 +176,17 @@ Rectangle {
177 function test_unlock_data() {
177 function test_unlock_data() {
179− {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true},
179+ {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true, pinLength: 4},
180− {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", unlockedSignal: true},
180+ {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", unlockedSignal: true, pinLength: -1},
181− {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", unlockedSignal: false},
181+ {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", unlockedSignal: false, pinLength: 4},
182− {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", unlockedSignal: false},
182+ {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", unlockedSignal: false, pinLength: -1},
183+ {tag: "flexible length", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true, pinLength: -1},
186 function test_unlock(data) {
187 function test_unlock(data) {
187 unlockedCheckBox.checked = false
188 unlockedCheckBox.checked = false
189+ pinLengthTextField.text = data.pinLength
188 LightDM.Greeter.authenticate(data.username)
190 LightDM.Greeter.authenticate(data.username)
189 waitForRendering(lockscreen)
191 waitForRendering(lockscreen)
@@ -199,7 +201,12 @@ Rectangle {
199 var button = findChild(lockscreen, "pinPadButton" + character)
201 var button = findChild(lockscreen, "pinPadButton" + character)
200 mouseClick(button, units.gu(1), units.gu(1))
202 mouseClick(button, units.gu(1), units.gu(1))
204+ if (data.pinLength == -1) {
205+ var pinPadButtonErase = findChild(lockscreen, "pinPadButtonErase");
206+ mouseClick(pinPadButtonErase, units.gu(1), units.gu(1));
203 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
210 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
204 if (!data.unlockedSignal) {
211 if (!data.unlockedSignal) {
205 // make sure the input is cleared on wrong input
212 // make sure the input is cleared on wrong input