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
=== modified file 'Greeter/Greeter.qml'
--- Greeter/Greeter.qml 2013-06-28 12:07:29 +0000
+++ Greeter/Greeter.qml 2013-08-02 14:09:24 +0000
@@ -34,7 +34,7 @@
3434
35 property alias dragHandleWidth: dragHandle.width35 property alias dragHandleWidth: dragHandle.width
36 property alias model: greeterContentLoader.model36 property alias model: greeterContentLoader.model
37 property bool locked: shown && multiUser && !greeterContentLoader.promptless37 property bool locked: shown && !LightDM.Greeter.promptless
3838
39 readonly property bool narrowMode: !multiUser && width <= units.gu(60)39 readonly property bool narrowMode: !multiUser && width <= units.gu(60)
40 readonly property bool multiUser: LightDM.Users.count > 140 readonly property bool multiUser: LightDM.Users.count > 1
@@ -59,7 +59,6 @@
59 anchors.fill: parent59 anchors.fill: parent
60 property var model: LightDM.Users60 property var model: LightDM.Users
61 property int currentIndex: 061 property int currentIndex: 0
62 property bool promptless: item ? item.promptless : false
63 property var infographicModel: LightDM.Infographic62 property var infographicModel: LightDM.Infographic
6463
65 source: required ? "GreeterContent.qml" : ""64 source: required ? "GreeterContent.qml" : ""
@@ -113,7 +112,7 @@
113 // UI element)112 // UI element)
114 distanceThreshold: 0113 distanceThreshold: 0
115114
116 enabled: !greeter.locked115 enabled: greeter.narrowMode || !greeter.locked
117116
118 direction: Direction.Leftwards117 direction: Direction.Leftwards
119 }118 }
120119
=== modified file 'Greeter/GreeterContent.qml'
--- Greeter/GreeterContent.qml 2013-07-03 10:33:48 +0000
+++ Greeter/GreeterContent.qml 2013-08-02 14:09:24 +0000
@@ -23,7 +23,6 @@
23 id: root23 id: root
24 anchors.fill: parent24 anchors.fill: parent
2525
26 property bool promptless: loginLoader.status == Loader.Ready && LightDM.Greeter.promptless
27 property bool ready: wallpaper.status == Image.Ready26 property bool ready: wallpaper.status == Image.Ready
28 property bool leftTeaserPressed: teasingMouseArea.pressed &&27 property bool leftTeaserPressed: teasingMouseArea.pressed &&
29 teasingMouseArea.mouseX < teasingMouseArea.width / 228 teasingMouseArea.mouseX < teasingMouseArea.width / 2
3029
=== modified file 'Shell.qml'
--- Shell.qml 2013-08-01 09:49:24 +0000
+++ Shell.qml 2013-08-02 14:09:24 +0000
@@ -552,7 +552,7 @@
552 anchors.bottom: parent.bottom552 anchors.bottom: parent.bottom
553 width: parent.width553 width: parent.width
554 dragAreaWidth: shell.edgeSize554 dragAreaWidth: shell.edgeSize
555 available: !greeter.locked555 available: !greeter.shown || greeter.narrowMode
556 onDashItemSelected: {556 onDashItemSelected: {
557 greeter.hide()557 greeter.hide()
558 // Animate if moving between application and dash558 // Animate if moving between application and dash
559559
=== modified file 'tests/autopilot/unity8/shell/emulators/greeter.py'
--- tests/autopilot/unity8/shell/emulators/greeter.py 2013-07-23 11:42:11 +0000
+++ tests/autopilot/unity8/shell/emulators/greeter.py 2013-08-02 14:09:24 +0000
@@ -25,7 +25,7 @@
2525
26 """An emulator that understands the greeter screen."""26 """An emulator that understands the greeter screen."""
2727
28 def unlock(self):28 def swipe(self):
29 """Swipe the greeter screen away."""29 """Swipe the greeter screen away."""
30 self.created.wait_for(True)30 self.created.wait_for(True)
31 touch = Touch.create()31 touch = Touch.create()
@@ -38,3 +38,6 @@
38 touch.drag(start_x, start_y, stop_x, stop_y)38 touch.drag(start_x, start_y, stop_x, stop_y)
3939
40 self.created.wait_for(False)40 self.created.wait_for(False)
41
42 def get_prompt(self):
43 return self.select_single("TextField", objectName="passwordInput")
4144
=== modified file 'tests/autopilot/unity8/shell/tests/test_hud.py'
--- tests/autopilot/unity8/shell/tests/test_hud.py 2013-07-25 05:10:12 +0000
+++ tests/autopilot/unity8/shell/tests/test_hud.py 2013-08-02 14:09:24 +0000
@@ -37,7 +37,7 @@
3737
38 """38 """
39 self.launch_unity()39 self.launch_unity()
40 self.main_window.get_greeter().unlock()40 self.main_window.get_greeter().swipe()
41 window = self.main_window.get_qml_view()41 window = self.main_window.get_qml_view()
42 hud_show_button = self.main_window.get_hud_show_button()42 hud_show_button = self.main_window.get_hud_show_button()
43 hud = self.main_window.get_hud()43 hud = self.main_window.get_hud()
@@ -58,7 +58,7 @@
5858
59 """59 """
60 self.launch_unity()60 self.launch_unity()
61 self.main_window.get_greeter().unlock()61 self.main_window.get_greeter().swipe()
62 window = self.main_window.get_qml_view()62 window = self.main_window.get_qml_view()
63 hud_show_button = self.main_window.get_hud_show_button()63 hud_show_button = self.main_window.get_hud_show_button()
64 hud = self.main_window.get_hud()64 hud = self.main_window.get_hud()
@@ -81,7 +81,7 @@
81 def test_hide_hud_click(self):81 def test_hide_hud_click(self):
82 """Tapping the close button of the Hud must dismiss it."""82 """Tapping the close button of the Hud must dismiss it."""
83 self.launch_unity()83 self.launch_unity()
84 self.main_window.get_greeter().unlock()84 self.main_window.get_greeter().swipe()
85 hud = self.main_window.get_hud()85 hud = self.main_window.get_hud()
8686
87 self._launch_test_app_from_app_screen()87 self._launch_test_app_from_app_screen()
@@ -97,7 +97,7 @@
9797
98 """98 """
99 self.launch_unity()99 self.launch_unity()
100 self.main_window.get_greeter().unlock()100 self.main_window.get_greeter().swipe()
101 hud = self.main_window.get_hud()101 hud = self.main_window.get_hud()
102 window = self.main_window.get_qml_view()102 window = self.main_window.get_qml_view()
103103
@@ -114,7 +114,7 @@
114 def test_launcher_hides_hud(self):114 def test_launcher_hides_hud(self):
115 """Opening the Launcher while the Hud is active must close the Hud."""115 """Opening the Launcher while the Hud is active must close the Hud."""
116 self.launch_unity()116 self.launch_unity()
117 self.main_window.get_greeter().unlock()117 self.main_window.get_greeter().swipe()
118 hud = self.main_window.get_hud()118 hud = self.main_window.get_hud()
119 launcher = self.main_window.get_launcher()119 launcher = self.main_window.get_launcher()
120120
121121
=== modified file 'tests/autopilot/unity8/shell/tests/test_lock_screen.py'
--- tests/autopilot/unity8/shell/tests/test_lock_screen.py 2013-07-25 17:50:36 +0000
+++ tests/autopilot/unity8/shell/tests/test_lock_screen.py 2013-08-02 14:09:24 +0000
@@ -40,52 +40,68 @@
40 """Must be able to unlock the PIN entry lock screen."""40 """Must be able to unlock the PIN entry lock screen."""
41 self.launch_unity()41 self.launch_unity()
42 greeter = self.main_window.get_greeter()42 greeter = self.main_window.get_greeter()
43 greeter.unlock()43
4444 if greeter.narrowMode:
45 lockscreen = self._wait_for_lockscreen()45 greeter.swipe()
46 self._enter_pincode("1234")46 lockscreen = self._wait_for_lockscreen()
4747 self._enter_pincode("1234")
48 self.assertThat(lockscreen.shown, Eventually(Equals(False)))48 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
49 else:
50 self._enter_prompt_passphrase("1234")
51 self.assertThat(greeter.shown, Eventually(Equals(False)))
4952
50 @with_lightdm_mock("single-passphrase")53 @with_lightdm_mock("single-passphrase")
51 def test_can_unlock_passphrase_screen(self):54 def test_can_unlock_passphrase_screen(self):
52 """Must be able to unlock the passphrase entry screen."""55 """Must be able to unlock the passphrase entry screen."""
53 self.launch_unity()56 self.launch_unity()
54 greeter = self.main_window.get_greeter()57 greeter = self.main_window.get_greeter()
55 greeter.unlock()58
5659 if greeter.narrowMode:
57 lockscreen = self._wait_for_lockscreen()60 greeter.swipe()
58 self._enter_passphrase("password")61 lockscreen = self._wait_for_lockscreen()
5962 self._enter_pin_passphrase("password")
60 self.assertThat(lockscreen.shown, Eventually(Equals(False)))63 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
64 else:
65 self._enter_prompt_passphrase("password")
66 self.assertThat(greeter.shown, Eventually(Equals(False)))
6167
62 @with_lightdm_mock("single-pin")68 @with_lightdm_mock("single-pin")
63 def test_pin_screen_wrong_code(self):69 def test_pin_screen_wrong_code(self):
64 """Entering the wrong pin code must not dismiss the lock screen."""70 """Entering the wrong pin code must not dismiss the lock screen."""
65 self.launch_unity()71 self.launch_unity()
66 greeter = self.main_window.get_greeter()72 greeter = self.main_window.get_greeter()
67 greeter.unlock()73
6874 if greeter.narrowMode:
69 lockscreen = self._wait_for_lockscreen()75 greeter.swipe()
70 self._enter_pincode("4321")76 lockscreen = self._wait_for_lockscreen()
7177 self._enter_pincode("4321")
72 pinentryField = self.main_window.get_pinentryField()78 pinentryField = self.main_window.get_pinentryField()
73 self.assertThat(pinentryField.text, Eventually(Equals("")))79 self.assertThat(pinentryField.text, Eventually(Equals("")))
74 self.assertThat(lockscreen.shown, Eventually(Equals(True)))80 self.assertThat(lockscreen.shown, Eventually(Equals(True)))
81 else:
82 self._enter_prompt_passphrase("4231")
83 prompt = self.main_window.get_greeter().get_prompt()
84 self.assertThat(prompt.text, Eventually(Equals("")))
85 self.assertThat(greeter.shown, Eventually(Equals(True)))
7586
76 @with_lightdm_mock("single-passphrase")87 @with_lightdm_mock("single-passphrase")
77 def test_passphrase_screen_wrong_password(self):88 def test_passphrase_screen_wrong_password(self):
78 """Entering the wrong password must not dismiss the lock screen."""89 """Entering the wrong password must not dismiss the lock screen."""
79 self.launch_unity()90 self.launch_unity()
80 greeter = self.main_window.get_greeter()91 greeter = self.main_window.get_greeter()
81 greeter.unlock()92
8293 if greeter.narrowMode:
83 lockscreen = self._wait_for_lockscreen()94 greeter.swipe()
84 self._enter_passphrase("foobar")95 lockscreen = self._wait_for_lockscreen()
8596 self._enter_pin_passphrase("foobar")
86 pinentryField = self.main_window.get_pinentryField()97 pinentryField = self.main_window.get_pinentryField()
87 self.assertThat(pinentryField.text, Eventually(Equals("")))98 self.assertThat(pinentryField.text, Eventually(Equals("")))
88 self.assertThat(lockscreen.shown, Eventually(Equals(True)))99 self.assertThat(lockscreen.shown, Eventually(Equals(True)))
100 else:
101 self._enter_prompt_passphrase("foobar")
102 prompt = self.main_window.get_greeter().get_prompt()
103 self.assertThat(prompt.text, Eventually(Equals("")))
104 self.assertThat(greeter.shown, Eventually(Equals(True)))
89105
90 def _wait_for_lockscreen(self):106 def _wait_for_lockscreen(self):
91 """Wait for the lock screen to load, and return it."""107 """Wait for the lock screen to load, and return it."""
@@ -114,9 +130,9 @@
114 )130 )
115 self.touch.tap_object(self.main_window.get_pinPadButton(int(num)))131 self.touch.tap_object(self.main_window.get_pinPadButton(int(num)))
116132
117 def _enter_passphrase(self, passphrase):133 def _enter_pin_passphrase(self, passphrase):
118 """Enter the password specified in 'passphrase' into the password entry134 """Enter the password specified in 'passphrase' into the password entry
119 field.135 field of the pin lock screen.
120136
121 :param passphrase: The string you want to enter.137 :param passphrase: The string you want to enter.
122 :raises: TypeError if passphrase is not a string.138 :raises: TypeError if passphrase is not a string.
@@ -129,3 +145,19 @@
129 self.touch.tap_object(pinentryField)145 self.touch.tap_object(pinentryField)
130 self.keyboard.type(passphrase)146 self.keyboard.type(passphrase)
131 self.keyboard.type("\n")147 self.keyboard.type("\n")
148
149 def _enter_prompt_passphrase(self, passphrase):
150 """Enter the password specified in 'passphrase' into the password entry
151 field of the main user list's prompt.
152
153 :param passphrase: The string you want to enter.
154 :raises: TypeError if passphrase is not a string.
155
156 """
157 if not isinstance(passphrase, basestring):
158 raise TypeError("'passphrase' parameter must be a string.")
159
160 prompt = self.main_window.get_greeter().get_prompt()
161 self.touch.tap_object(prompt)
162 self.keyboard.type(passphrase)
163 self.keyboard.type("\n")
132164
=== modified file 'tests/mocks/LightDM/single/GreeterPrivate.cpp'
--- tests/mocks/LightDM/single/GreeterPrivate.cpp 2013-06-05 22:03:08 +0000
+++ tests/mocks/LightDM/single/GreeterPrivate.cpp 2013-08-02 14:09:24 +0000
@@ -34,10 +34,8 @@
34{34{
35 Q_Q(Greeter);35 Q_Q(Greeter);
3636
37 if (authenticationUser == "one") {37 authenticated = true;
38 authenticated = true;38 Q_EMIT q->authenticationComplete();
39 Q_EMIT q->authenticationComplete();
40 }
41}39}
4240
43void GreeterPrivate::handleRespond(QString const &response)41void GreeterPrivate::handleRespond(QString const &response)

Subscribers

People subscribed via source and target branches