Merge lp:~mterry/unity8/lockscreen-autopilot into lp:unity8

Proposed by Michael Terry
Status: Merged
Approved by: Michael Zanetti
Approved revision: 146
Merged at revision: 160
Proposed branch: lp:~mterry/unity8/lockscreen-autopilot
Merge into: lp:unity8
Diff against target: 273 lines (+76/-45)
7 files modified
Greeter/Greeter.qml (+2/-3)
Greeter/GreeterContent.qml (+0/-1)
Shell.qml (+1/-1)
tests/autopilot/unity8/shell/emulators/greeter.py (+4/-1)
tests/autopilot/unity8/shell/tests/test_hud.py (+5/-5)
tests/autopilot/unity8/shell/tests/test_lock_screen.py (+62/-30)
tests/mocks/LightDM/single/GreeterPrivate.cpp (+2/-4)
To merge this branch: bzr merge lp:~mterry/unity8/lockscreen-autopilot
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Katie Taylor design Pending
Review via email: mp+177225@code.launchpad.net

Commit message

Fixes the lockscreen and swiping on the greeter still being possible even when in tablet mode.

Description of the change

Fixes the lockscreen and swiping on the greeter still being possible even when in tablet mode.

Then the lockscreen autopilot tests need to be adjusted for tablet mode (which really makes them half lockscreen tests, half greeter tests, but I'm ok with that).

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

From what I understood from design, swiping the greeter should still be possible if it is not locked (i.e. for the guest user)

The linked bug is more about the lockscreens showing up in tablet mode even though the actual password entry is already handled on the greeter directly. So not really related to the swiping.

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

> From what I understood from design, swiping the greeter should still be possible if it is not locked (i.e. for the guest user)

I thought design's stance on the tablet mode is "whatever desktop does now". And the desktop greeter does not include swiping. I don't remember design specifically addressing swiping.

> The linked bug is more about the lockscreens showing up in tablet mode even though the actual password entry is already handled on the greeter directly. So not really related to the swiping.

The lockscreen showing up in tablet mode is fixed by the change in Shell.qml. The swiping is a bonus fix in Greeter.qml because it appeared to be making the same mistake Shell.qml did by treating 'locked' as a synonym for tablet mode (subject of course to whether swiping should be allowed in tablet mode or not, as per your first comment).

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

> > From what I understood from design, swiping the greeter should still be
> possible if it is not locked (i.e. for the guest user)
>
> I thought design's stance on the tablet mode is "whatever desktop does now".
> And the desktop greeter does not include swiping. I don't remember design
> specifically addressing swiping.
>
> > The linked bug is more about the lockscreens showing up in tablet mode even
> though the actual password entry is already handled on the greeter directly.
> So not really related to the swiping.
>
> The lockscreen showing up in tablet mode is fixed by the change in Shell.qml.
> The swiping is a bonus fix in Greeter.qml because it appeared to be making the
> same mistake Shell.qml did by treating 'locked' as a synonym for tablet mode
> (subject of course to whether swiping should be allowed in tablet mode or not,
> as per your first comment).

When I joined the unity team the Tablet greeter did only swipe and design had a hard time to accept that it cannot be swiped if a password on the Greeter is required. So I think they want it to swipe whenever possible unless they changed their mind like with the rotating list of users. We need to check back with them.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Added Katie to the reviewers.

@Katie: On the tablet, should the user be able to swipe away the greeter in case there is no password set like it is now or should that be disabled in order to make it more like the desktop version?

When I did the first versions the swiping was clearly required but of course that might have changed. Please check back with Oren as he was the one designing the interactions for me in the first edition.

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

Confirmed: On tablet, the user should be able to swipe away the greeter if there is no password set, like it is now and similar to the phone.

In the future, if the desktop is touch, I imagine the user can swipe away a non-password protected greeter too :)

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 :
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
Michael Zanetti (mzanetti) wrote :

Thanks a lot Michael!

review: Approve
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 :
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 :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Giving up... can you please merge trunk so we get the more stable HUD tests in here...

review: Needs Fixing
145. By Michael Terry

Merge from trunk

146. By Michael Terry

Make sure launcher is available when greeter is not shown

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

good now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Greeter/Greeter.qml'
2--- Greeter/Greeter.qml 2013-06-28 12:07:29 +0000
3+++ Greeter/Greeter.qml 2013-08-02 14:09:24 +0000
4@@ -34,7 +34,7 @@
5
6 property alias dragHandleWidth: dragHandle.width
7 property alias model: greeterContentLoader.model
8- property bool locked: shown && multiUser && !greeterContentLoader.promptless
9+ property bool locked: shown && !LightDM.Greeter.promptless
10
11 readonly property bool narrowMode: !multiUser && width <= units.gu(60)
12 readonly property bool multiUser: LightDM.Users.count > 1
13@@ -59,7 +59,6 @@
14 anchors.fill: parent
15 property var model: LightDM.Users
16 property int currentIndex: 0
17- property bool promptless: item ? item.promptless : false
18 property var infographicModel: LightDM.Infographic
19
20 source: required ? "GreeterContent.qml" : ""
21@@ -113,7 +112,7 @@
22 // UI element)
23 distanceThreshold: 0
24
25- enabled: !greeter.locked
26+ enabled: greeter.narrowMode || !greeter.locked
27
28 direction: Direction.Leftwards
29 }
30
31=== modified file 'Greeter/GreeterContent.qml'
32--- Greeter/GreeterContent.qml 2013-07-03 10:33:48 +0000
33+++ Greeter/GreeterContent.qml 2013-08-02 14:09:24 +0000
34@@ -23,7 +23,6 @@
35 id: root
36 anchors.fill: parent
37
38- property bool promptless: loginLoader.status == Loader.Ready && LightDM.Greeter.promptless
39 property bool ready: wallpaper.status == Image.Ready
40 property bool leftTeaserPressed: teasingMouseArea.pressed &&
41 teasingMouseArea.mouseX < teasingMouseArea.width / 2
42
43=== modified file 'Shell.qml'
44--- Shell.qml 2013-08-01 09:49:24 +0000
45+++ Shell.qml 2013-08-02 14:09:24 +0000
46@@ -552,7 +552,7 @@
47 anchors.bottom: parent.bottom
48 width: parent.width
49 dragAreaWidth: shell.edgeSize
50- available: !greeter.locked
51+ available: !greeter.shown || greeter.narrowMode
52 onDashItemSelected: {
53 greeter.hide()
54 // Animate if moving between application and dash
55
56=== modified file 'tests/autopilot/unity8/shell/emulators/greeter.py'
57--- tests/autopilot/unity8/shell/emulators/greeter.py 2013-07-23 11:42:11 +0000
58+++ tests/autopilot/unity8/shell/emulators/greeter.py 2013-08-02 14:09:24 +0000
59@@ -25,7 +25,7 @@
60
61 """An emulator that understands the greeter screen."""
62
63- def unlock(self):
64+ def swipe(self):
65 """Swipe the greeter screen away."""
66 self.created.wait_for(True)
67 touch = Touch.create()
68@@ -38,3 +38,6 @@
69 touch.drag(start_x, start_y, stop_x, stop_y)
70
71 self.created.wait_for(False)
72+
73+ def get_prompt(self):
74+ return self.select_single("TextField", objectName="passwordInput")
75
76=== modified file 'tests/autopilot/unity8/shell/tests/test_hud.py'
77--- tests/autopilot/unity8/shell/tests/test_hud.py 2013-07-25 05:10:12 +0000
78+++ tests/autopilot/unity8/shell/tests/test_hud.py 2013-08-02 14:09:24 +0000
79@@ -37,7 +37,7 @@
80
81 """
82 self.launch_unity()
83- self.main_window.get_greeter().unlock()
84+ self.main_window.get_greeter().swipe()
85 window = self.main_window.get_qml_view()
86 hud_show_button = self.main_window.get_hud_show_button()
87 hud = self.main_window.get_hud()
88@@ -58,7 +58,7 @@
89
90 """
91 self.launch_unity()
92- self.main_window.get_greeter().unlock()
93+ self.main_window.get_greeter().swipe()
94 window = self.main_window.get_qml_view()
95 hud_show_button = self.main_window.get_hud_show_button()
96 hud = self.main_window.get_hud()
97@@ -81,7 +81,7 @@
98 def test_hide_hud_click(self):
99 """Tapping the close button of the Hud must dismiss it."""
100 self.launch_unity()
101- self.main_window.get_greeter().unlock()
102+ self.main_window.get_greeter().swipe()
103 hud = self.main_window.get_hud()
104
105 self._launch_test_app_from_app_screen()
106@@ -97,7 +97,7 @@
107
108 """
109 self.launch_unity()
110- self.main_window.get_greeter().unlock()
111+ self.main_window.get_greeter().swipe()
112 hud = self.main_window.get_hud()
113 window = self.main_window.get_qml_view()
114
115@@ -114,7 +114,7 @@
116 def test_launcher_hides_hud(self):
117 """Opening the Launcher while the Hud is active must close the Hud."""
118 self.launch_unity()
119- self.main_window.get_greeter().unlock()
120+ self.main_window.get_greeter().swipe()
121 hud = self.main_window.get_hud()
122 launcher = self.main_window.get_launcher()
123
124
125=== modified file 'tests/autopilot/unity8/shell/tests/test_lock_screen.py'
126--- tests/autopilot/unity8/shell/tests/test_lock_screen.py 2013-07-25 17:50:36 +0000
127+++ tests/autopilot/unity8/shell/tests/test_lock_screen.py 2013-08-02 14:09:24 +0000
128@@ -40,52 +40,68 @@
129 """Must be able to unlock the PIN entry lock screen."""
130 self.launch_unity()
131 greeter = self.main_window.get_greeter()
132- greeter.unlock()
133-
134- lockscreen = self._wait_for_lockscreen()
135- self._enter_pincode("1234")
136-
137- self.assertThat(lockscreen.shown, Eventually(Equals(False)))
138+
139+ if greeter.narrowMode:
140+ greeter.swipe()
141+ lockscreen = self._wait_for_lockscreen()
142+ self._enter_pincode("1234")
143+ self.assertThat(lockscreen.shown, Eventually(Equals(False)))
144+ else:
145+ self._enter_prompt_passphrase("1234")
146+ self.assertThat(greeter.shown, Eventually(Equals(False)))
147
148 @with_lightdm_mock("single-passphrase")
149 def test_can_unlock_passphrase_screen(self):
150 """Must be able to unlock the passphrase entry screen."""
151 self.launch_unity()
152 greeter = self.main_window.get_greeter()
153- greeter.unlock()
154-
155- lockscreen = self._wait_for_lockscreen()
156- self._enter_passphrase("password")
157-
158- self.assertThat(lockscreen.shown, Eventually(Equals(False)))
159+
160+ if greeter.narrowMode:
161+ greeter.swipe()
162+ lockscreen = self._wait_for_lockscreen()
163+ self._enter_pin_passphrase("password")
164+ self.assertThat(lockscreen.shown, Eventually(Equals(False)))
165+ else:
166+ self._enter_prompt_passphrase("password")
167+ self.assertThat(greeter.shown, Eventually(Equals(False)))
168
169 @with_lightdm_mock("single-pin")
170 def test_pin_screen_wrong_code(self):
171 """Entering the wrong pin code must not dismiss the lock screen."""
172 self.launch_unity()
173 greeter = self.main_window.get_greeter()
174- greeter.unlock()
175-
176- lockscreen = self._wait_for_lockscreen()
177- self._enter_pincode("4321")
178-
179- pinentryField = self.main_window.get_pinentryField()
180- self.assertThat(pinentryField.text, Eventually(Equals("")))
181- self.assertThat(lockscreen.shown, Eventually(Equals(True)))
182+
183+ if greeter.narrowMode:
184+ greeter.swipe()
185+ lockscreen = self._wait_for_lockscreen()
186+ self._enter_pincode("4321")
187+ pinentryField = self.main_window.get_pinentryField()
188+ self.assertThat(pinentryField.text, Eventually(Equals("")))
189+ self.assertThat(lockscreen.shown, Eventually(Equals(True)))
190+ else:
191+ self._enter_prompt_passphrase("4231")
192+ prompt = self.main_window.get_greeter().get_prompt()
193+ self.assertThat(prompt.text, Eventually(Equals("")))
194+ self.assertThat(greeter.shown, Eventually(Equals(True)))
195
196 @with_lightdm_mock("single-passphrase")
197 def test_passphrase_screen_wrong_password(self):
198 """Entering the wrong password must not dismiss the lock screen."""
199 self.launch_unity()
200 greeter = self.main_window.get_greeter()
201- greeter.unlock()
202-
203- lockscreen = self._wait_for_lockscreen()
204- self._enter_passphrase("foobar")
205-
206- pinentryField = self.main_window.get_pinentryField()
207- self.assertThat(pinentryField.text, Eventually(Equals("")))
208- self.assertThat(lockscreen.shown, Eventually(Equals(True)))
209+
210+ if greeter.narrowMode:
211+ greeter.swipe()
212+ lockscreen = self._wait_for_lockscreen()
213+ self._enter_pin_passphrase("foobar")
214+ pinentryField = self.main_window.get_pinentryField()
215+ self.assertThat(pinentryField.text, Eventually(Equals("")))
216+ self.assertThat(lockscreen.shown, Eventually(Equals(True)))
217+ else:
218+ self._enter_prompt_passphrase("foobar")
219+ prompt = self.main_window.get_greeter().get_prompt()
220+ self.assertThat(prompt.text, Eventually(Equals("")))
221+ self.assertThat(greeter.shown, Eventually(Equals(True)))
222
223 def _wait_for_lockscreen(self):
224 """Wait for the lock screen to load, and return it."""
225@@ -114,9 +130,9 @@
226 )
227 self.touch.tap_object(self.main_window.get_pinPadButton(int(num)))
228
229- def _enter_passphrase(self, passphrase):
230+ def _enter_pin_passphrase(self, passphrase):
231 """Enter the password specified in 'passphrase' into the password entry
232- field.
233+ field of the pin lock screen.
234
235 :param passphrase: The string you want to enter.
236 :raises: TypeError if passphrase is not a string.
237@@ -129,3 +145,19 @@
238 self.touch.tap_object(pinentryField)
239 self.keyboard.type(passphrase)
240 self.keyboard.type("\n")
241+
242+ def _enter_prompt_passphrase(self, passphrase):
243+ """Enter the password specified in 'passphrase' into the password entry
244+ field of the main user list's prompt.
245+
246+ :param passphrase: The string you want to enter.
247+ :raises: TypeError if passphrase is not a string.
248+
249+ """
250+ if not isinstance(passphrase, basestring):
251+ raise TypeError("'passphrase' parameter must be a string.")
252+
253+ prompt = self.main_window.get_greeter().get_prompt()
254+ self.touch.tap_object(prompt)
255+ self.keyboard.type(passphrase)
256+ self.keyboard.type("\n")
257
258=== modified file 'tests/mocks/LightDM/single/GreeterPrivate.cpp'
259--- tests/mocks/LightDM/single/GreeterPrivate.cpp 2013-06-05 22:03:08 +0000
260+++ tests/mocks/LightDM/single/GreeterPrivate.cpp 2013-08-02 14:09:24 +0000
261@@ -34,10 +34,8 @@
262 {
263 Q_Q(Greeter);
264
265- if (authenticationUser == "one") {
266- authenticated = true;
267- Q_EMIT q->authenticationComplete();
268- }
269+ authenticated = true;
270+ Q_EMIT q->authenticationComplete();
271 }
272
273 void GreeterPrivate::handleRespond(QString const &response)

Subscribers

People subscribed via source and target branches