on xenial help sign in
update Lockscreen tests for the brought back autoconfirm mode
a67e845Michael Zanetti
tests/qmltests/Greeter/tst_Lockscreen.qml+23−13
@@ -389,20 +389,30 @@ Rectangle {
389 mouseClick(pinPadButton5, units.gu(1), units.gu(1));
389 mouseClick(pinPadButton5, units.gu(1), units.gu(1));
390 tryCompare(backspaceButton, "opacity", 1)
390 tryCompare(backspaceButton, "opacity", 1)
391
391
392− if (data.maxPinLength == -1) {
392+ if (data.maxPinLength == data.minPinLength && data.minPinLength > 0) {
393− // Undefined maxLength... make sure all presses are recorded
393+ // Autoconfirm mode. This will automatically confirm (and with it reset)
394+ // the textfield every data.minPinLength presses
395+ if (i+1 < data.minPinLength) {
394− compare(inputField.text.length, i+1);
396+ compare(inputField.text.length, i + 1);
397+ } else {
398+ compare(inputField.text.length, (i+1) % data.minPinLength)
399+ }
395 } else {
400 } else {
401+ if (data.maxPinLength == -1) {
402+ // Undefined maxLength... make sure all presses are recorded
403+ compare(inputField.text.length, i+1);
404+ } else {
396− // We have a max length. Make sure we're only accepting maxLength presses
405+ // We have a max length. Make sure we're only accepting maxLength presses
397− compare(inputField.text.length, Math.min(data.maxPinLength, i+1));
406+ compare(inputField.text.length, Math.min(data.maxPinLength, i+1));
398− }
407+ }
399−
408+
400− if (data.minPinLength == -1) {
409+ if (data.minPinLength == -1) {
401− // Undefined minLength. Make sure confirm button is always enabled
410+ // Undefined minLength. Make sure confirm button is always enabled
402− compare(confirmButton.enabled, true);
411+ compare(confirmButton.enabled, true);
403− } else {
412+ } else {
404− // We have a min length. Make sure the confirm button is only enabled when met.
413+ // We have a min length. Make sure the confirm button is only enabled when met.
405− compare(confirmButton.enabled, (i+1) >= data.minPinLength);
414+ compare(confirmButton.enabled, (i+1) >= data.minPinLength);
415+ }
406 }
416 }
407 }
417 }
408 }
418 }