@@ -34,12 +34,11 @@ Rectangle {
34 anchors.fill: parent
34 anchors.fill: parent
35 anchors.rightMargin: units.gu(40)
35 anchors.rightMargin: units.gu(40)
36 infoText: infoTextTextField.text
36 infoText: infoTextTextField.text
37− retryText: retryCountTextField.text
38 errorText: errorTextTextField.text
37 errorText: errorTextTextField.text
39 alphaNumeric: pinPadCheckBox.checked
38 alphaNumeric: pinPadCheckBox.checked
40 minPinLength: minPinLengthTextField.text
39 minPinLength: minPinLengthTextField.text
41 maxPinLength: maxPinLengthTextField.text
40 maxPinLength: maxPinLengthTextField.text
42− username: "Lola"
41+ delayMinutes: delayMinutesTextField.text
43 background: "../../../qml/graphics/phone_background.jpg"
42 background: "../../../qml/graphics/phone_background.jpg"
@@ -121,12 +120,12 @@ Rectangle {
123 TextField {
122 TextField {
124− id: retryCountTextField
123+ id: delayMinutesTextField
125 width: units.gu(7)
124 width: units.gu(7)
126− text: "3 retries left"
125+ text: "0"
129− text: "Retries left"
128+ text: "Delay Minutes"
@@ -193,6 +192,7 @@ Rectangle {
194 function cleanup() {
193 function cleanup() {
195 lockscreen.clear(false);
194 lockscreen.clear(false);
195+ delayMinutesTextField.text = "0"
198 function waitForLockscreenReady() {
198 function waitForLockscreenReady() {
@@ -237,8 +237,8 @@ Rectangle {
238 function test_labels_data() {
238 function test_labels_data() {
240− {tag: "numeric", alphanumeric: false, infoText: "Please enter your PIN", username: "foobar" },
240+ {tag: "numeric", alphanumeric: false, infoText: "Please enter your PIN" },
241− {tag: "alphanumeric", alphanumeric: true, infoText: "Please enter your password", username: "Lola" }
241+ {tag: "alphanumeric", alphanumeric: true, infoText: "Please enter your password" }
@@ -246,15 +246,9 @@ Rectangle {
246 pinPadCheckBox.checked = data.alphanumeric
246 pinPadCheckBox.checked = data.alphanumeric
247 lockscreen.infoText = data.infoText
247 lockscreen.infoText = data.infoText
248 waitForLockscreenReady();
248 waitForLockscreenReady();
249− if (data.alphanumeric) {
250− compare(findChild(lockscreen, "pinentryField").placeholderText, data.infoText, "Placeholdertext is not what it should be")
251− compare(findChild(lockscreen, "greeterLabel").text, "Hello " + data.username, "Greeter is not set correctly")
253− compare(findChild(lockscreen, "infoTextLabel").text, data.infoText, "Placeholdertext is not what it should be")
249+ compare(findChild(lockscreen, "infoTextLabel").text, data.infoText, "Placeholdertext is not what it should be")
258 function test_unlock_data() {
252 function test_unlock_data() {
260 {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", minPinLength: 4, maxPinLength: 4},
254 {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", minPinLength: 4, maxPinLength: 4},
@@ -274,8 +268,7 @@ Rectangle {
275 var inputField = findChild(lockscreen, "pinentryField")
269 var inputField = findChild(lockscreen, "pinentryField")
276 if (data.alphanumeric) {
270 if (data.alphanumeric) {
277− mouseClick(inputField, units.gu(1), units.gu(1))
278− tryCompare(inputField, "focus", true);
271+ tryCompare(inputField, "activeFocus", true);
279 typeString(data.password)
272 typeString(data.password)
280 keyClick(Qt.Key_Enter)
273 keyClick(Qt.Key_Enter)
@@ -305,7 +298,6 @@ Rectangle {
306 var inputField = findChild(lockscreen, "pinentryField")
299 var inputField = findChild(lockscreen, "pinentryField")
307 if (data.alphanumeric) {
300 if (data.alphanumeric) {
308− mouseClick(inputField, units.gu(1), units.gu(1))
309 tryCompare(inputField, "activeFocus", true);
301 tryCompare(inputField, "activeFocus", true);
310 typeString("1")
302 typeString("1")
@@ -419,22 +411,6 @@ Rectangle {
422− function test_retryDisplay_data() {
424− {tag: "empty", retryText: " "},
425− {tag: "3 retries left", retryText: "3 retries left"},
429− function test_retryDisplay(data) {
430− pinPadCheckBox.checked = false
431− waitForLockscreenReady();
433− retryCountTextField.text = data.retryText;
434− var label = findChild(lockscreen, "retryLabel")
435− compare(label.text, data.retryText);
438 function test_infoPopup() {
414 function test_infoPopup() {
439 verify(findChild(root, "infoPopup") === null);
415 verify(findChild(root, "infoPopup") === null);
440 lockscreen.showInfoPopup("foo", "bar");
416 lockscreen.showInfoPopup("foo", "bar");
@@ -470,6 +446,13 @@ Rectangle {
470 var label = findChild(lockscreen, "infoTextLabel")
446 var label = findChild(lockscreen, "infoTextLabel")
471 compare(label.text, data.text);
447 compare(label.text, data.text);
450+ function test_delayMinutes() {
451+ delayMinutesTextField.text = "4"
452+ waitForLockscreenReady()
453+ var label = findChild(lockscreen, "deviceLockedLabel")
454+ compare(label.text, "Device Locked")
475 SignalSpy {
458 SignalSpy {