Merge lp:~mzanetti/unity8/generic-lockscreen into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Michał Sawicz
Approved revision: 480
Merged at revision: 547
Proposed branch: lp:~mzanetti/unity8/generic-lockscreen
Merge into: lp:unity8
Diff against target: 225 lines (+66/-37)
5 files modified
Greeter/Lockscreen.qml (+6/-18)
Greeter/PassphraseLockscreen.qml (+1/-0)
Greeter/PinLockscreen.qml (+1/-0)
Shell.qml (+12/-1)
tests/qmltests/Greeter/tst_Lockscreen.qml (+46/-18)
To merge this branch: bzr merge lp:~mzanetti/unity8/generic-lockscreen
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Mirco Müller (community) Approve
Review via email: mp+191951@code.launchpad.net

Commit message

drop all references to LighDM from the Lockscreen

This should make it generic enough to allow reusing it for SIM PIN entry

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:479
http://jenkins.qa.ubuntu.com/job/unity8-ci/1455/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-saucy/5108
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-touch/3086/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-saucy/2326
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-amd64-ci/478
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1455
        deb: http://jenkins.qa.ubuntu.com/job/unity8-saucy-armhf-ci/1455/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-saucy-i386-ci/1454
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-saucy/1272
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/983
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-amd64/983/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3088
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-saucy-armhf/3088/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-maguro/2583/console
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/2634/console
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/196
    SUCCESS: http://10.97.0.26:8080/job/touch-flash-device/197

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/unity8-ci/1455/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mirco Müller (macslow) wrote :

There are three merge-conflicts in tests/qmltests/Greeter/tst_Lockscreen.qml...

1.)
<<<<<<< TREE
                {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234"},
                {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password"},
                {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321"},
                {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap"},
=======
                {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true, pinLength: 4},
                {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", unlockedSignal: true, pinLength: -1},
                {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", unlockedSignal: false, pinLength: 4},
                {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", unlockedSignal: false, pinLength: -1},
                {tag: "flexible length", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true, pinLength: -1},
>>>>>>> MERGE-SOURCE

2.)
<<<<<<< TREE
            enteredLabel.text = ""
=======
            unlockedCheckBox.checked = false
            pinLengthTextField.text = data.pinLength
>>>>>>> MERGE-SOURCE

3.)
<<<<<<< TREE
            tryCompare(enteredLabel, "text", data.password)
        }

        function test_clear_data() {
            return [
                {tag: "animated PIN", animation: true, alphanumeric: false},
                {tag: "not animated PIN", animation: false, alphanumeric: false},
                {tag: "animated passphrase", animation: true, alphanumeric: true},
                {tag: "not animated passphrase", animation: false, alphanumeric: true}
            ];
        }

        function test_clear(data) {
            pinPadCheckBox.checked = data.alphanumeric
            waitForRendering(lockscreen)

            var inputField = findChild(lockscreen, "pinentryField")
            if (data.alphanumeric) {
                mouseClick(inputField, units.gu(1), units.gu(1))
                typeString("1")
=======

            tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
            if (!data.unlockedSignal) {
                // make sure the input is cleared on wrong input
                tryCompareFunction(function() {return inputField.text.length == 0}, true)
>>>>>>> MERGE-SOURCE

review: Needs Fixing
Revision history for this message
Mirco Müller (macslow) wrote :

Looking good now.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Had to abort, qmluitests failed due to hash sum mismatches :/

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/742/
Executed test runs:
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-cleanup-mbs/3350
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/933
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/917/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/337
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/128
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/128
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/128/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/128
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/837
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/933
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/933/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/917
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/917/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3513/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1605

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/748/
Executed test runs:
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-cleanup-mbs/3357
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/945
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/929
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/348
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/134
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/134
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/134/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/134
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/849
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/945
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/945/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/929
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/929/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3525
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1624

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/753/
Executed test runs:
    None: http://s-jenkins.ubuntu-ci:8080/job/generic-cleanup-mbs/3364/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/973
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/957
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/361
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/139
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/139
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/139/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/139
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/873
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/973
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/973/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/957
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/957/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/3548
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/1648

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Greeter/Lockscreen.qml'
2--- Greeter/Lockscreen.qml 2013-10-25 12:59:01 +0000
3+++ Greeter/Lockscreen.qml 2013-11-18 15:21:12 +0000
4@@ -17,7 +17,6 @@
5 import QtQuick 2.0
6 import Ubuntu.Components 0.1
7 import "../Components"
8-import LightDM 0.1 as LightDM
9
10 Showable {
11 id: root
12@@ -37,7 +36,7 @@
13
14 property url background: ""
15
16- signal unlocked()
17+ signal entered(string passphrase)
18 signal cancel()
19 signal emergencyCall()
20
21@@ -53,6 +52,10 @@
22 pinPadLoader.resetting = false;
23 }
24
25+ function clear(showAnimation) {
26+ pinPadLoader.item.clear(showAnimation);
27+ }
28+
29 Rectangle {
30 // In case background fails to load or is undefined
31 id: backgroundBackup
32@@ -92,7 +95,7 @@
33 target: pinPadLoader.item
34
35 onEntered: {
36- LightDM.Greeter.respond(passphrase);
37+ root.entered(passphrase);
38 }
39
40 onCancel: {
41@@ -150,19 +153,4 @@
42 anchors.horizontalCenter: parent.horizontalCenter
43 }
44 }
45-
46- Connections {
47- target: LightDM.Greeter
48-
49- onAuthenticationComplete: {
50- if (LightDM.Greeter.promptless) {
51- return;
52- }
53- if (LightDM.Greeter.authenticated) {
54- root.unlocked();
55- } else {
56- pinPadLoader.item.clear(true);
57- }
58- }
59- }
60 }
61
62=== modified file 'Greeter/PassphraseLockscreen.qml'
63--- Greeter/PassphraseLockscreen.qml 2013-06-06 12:18:34 +0000
64+++ Greeter/PassphraseLockscreen.qml 2013-11-18 15:21:12 +0000
65@@ -82,6 +82,7 @@
66
67 WrongPasswordAnimation {
68 id: wrongPasswordAnimation
69+ objectName: "wrongPasswordAnimation"
70 target: pinentryField
71 }
72 }
73
74=== modified file 'Greeter/PinLockscreen.qml'
75--- Greeter/PinLockscreen.qml 2013-10-17 13:08:36 +0000
76+++ Greeter/PinLockscreen.qml 2013-11-18 15:21:12 +0000
77@@ -210,6 +210,7 @@
78
79 WrongPasswordAnimation {
80 id: wrongPasswordAnimation
81+ objectName: "wrongPasswordAnimation"
82 target: pinentryField
83 }
84 }
85
86=== modified file 'Shell.qml'
87--- Shell.qml 2013-11-08 08:48:11 +0000
88+++ Shell.qml 2013-11-18 15:21:12 +0000
89@@ -416,7 +416,7 @@
90 height: parent.height - panel.panelHeight
91 background: shell.background
92
93- onUnlocked: lockscreen.hide()
94+ onEntered: LightDM.Greeter.respond(passphrase);
95 onCancel: greeter.show()
96
97 Component.onCompleted: {
98@@ -442,6 +442,17 @@
99 lockscreen.show();
100 }
101 }
102+
103+ onAuthenticationComplete: {
104+ if (LightDM.Greeter.promptless) {
105+ return;
106+ }
107+ if (LightDM.Greeter.authenticated) {
108+ lockscreen.hide();
109+ } else {
110+ lockscreen.clear(true);
111+ }
112+ }
113 }
114
115 Greeter {
116
117=== modified file 'tests/qmltests/Greeter/tst_Lockscreen.qml'
118--- tests/qmltests/Greeter/tst_Lockscreen.qml 2013-10-17 13:08:36 +0000
119+++ tests/qmltests/Greeter/tst_Lockscreen.qml 2013-11-18 15:21:12 +0000
120@@ -41,7 +41,7 @@
121 target: lockscreen
122
123 onEmergencyCall: emergencyCheckBox.checked = true
124- onUnlocked: unlockedCheckBox.checked = true
125+ onEntered: enteredLabel.text = passphrase
126 }
127
128 Connections {
129@@ -99,12 +99,11 @@
130 anchors.verticalCenter: parent.verticalCenter
131 }
132 Row {
133- CheckBox {
134- id: unlockedCheckBox
135+ Label {
136+ text: "Entered:"
137 }
138 Label {
139- text: "Unlocked signal"
140- anchors.verticalCenter: parent.verticalCenter
141+ id: enteredLabel
142 }
143 }
144 Button {
145@@ -176,16 +175,16 @@
146
147 function test_unlock_data() {
148 return [
149- {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true, pinLength: 4},
150- {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", unlockedSignal: true, pinLength: -1},
151- {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", unlockedSignal: false, pinLength: 4},
152- {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", unlockedSignal: false, pinLength: -1},
153- {tag: "flexible length", alphanumeric: false, username: "has-pin", password: "1234", unlockedSignal: true, pinLength: -1},
154+ {tag: "numeric", alphanumeric: false, username: "has-pin", password: "1234", pinLength: 4},
155+ {tag: "alphanumeric", alphanumeric: true, username: "has-password", password: "password", pinLength: -1},
156+ {tag: "numeric (wrong)", alphanumeric: false, username: "has-pin", password: "4321", pinLength: 4},
157+ {tag: "alphanumeric (wrong)", alphanumeric: true, username: "has-password", password: "drowssap", pinLength: -1},
158+ {tag: "flexible length", alphanumeric: false, username: "has-pin", password: "1234", pinLength: -1},
159 ]
160 }
161
162 function test_unlock(data) {
163- unlockedCheckBox.checked = false
164+ enteredLabel.text = ""
165 pinLengthTextField.text = data.pinLength
166 LightDM.Greeter.authenticate(data.username)
167 waitForRendering(lockscreen)
168@@ -206,14 +205,43 @@
169 mouseClick(pinPadButtonErase, units.gu(1), units.gu(1));
170 }
171 }
172-
173- tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
174- if (!data.unlockedSignal) {
175- // make sure the input is cleared on wrong input
176- tryCompareFunction(function() {return inputField.text.length == 0}, true)
177+ tryCompare(enteredLabel, "text", data.password)
178+ }
179+
180+ function test_clear_data() {
181+ return [
182+ {tag: "animated PIN", animation: true, alphanumeric: false},
183+ {tag: "not animated PIN", animation: false, alphanumeric: false},
184+ {tag: "animated passphrase", animation: true, alphanumeric: true},
185+ {tag: "not animated passphrase", animation: false, alphanumeric: true}
186+ ];
187+ }
188+
189+ function test_clear(data) {
190+ pinPadCheckBox.checked = data.alphanumeric
191+ waitForRendering(lockscreen)
192+
193+ var inputField = findChild(lockscreen, "pinentryField")
194+ if (data.alphanumeric) {
195+ mouseClick(inputField, units.gu(1), units.gu(1))
196+ typeString("1")
197 } else {
198- tryCompareFunction(function() {return inputField.text.length > 0}, true)
199+ var button = findChild(lockscreen, "pinPadButton1")
200+ mouseClick(button, units.gu(1), units.gu(1))
201 }
202+
203+ var animation = findInvisibleChild(lockscreen, "wrongPasswordAnimation")
204+
205+ tryCompare(inputField, "text", "1")
206+
207+ lockscreen.clear(data.animation)
208+ tryCompare(inputField, "text", "")
209+
210+ wait(0) // Trigger event loop to make sure the animation would start running
211+ compare(animation.running, data.animation)
212+
213+ // wait for animation to finish to not disturb other tests
214+ tryCompare(animation, "running", false)
215 }
216
217 function test_backspace_data() {
218@@ -224,7 +252,7 @@
219 }
220
221 function test_backspace(data) {
222- LightDM.Greeter.authenticate("has-pin");
223+ pinPadCheckBox.checked = false
224 pinLengthTextField.text = data.pinLength
225 waitForRendering(lockscreen);
226

Subscribers

People subscribed via source and target branches