@@ -20,6 +20,7 @@
21from __future__ import absolute_import
21from __future__ import absolute_import
23+from unity8.process_helpers import unlock_unity
23from unity8.shell import with_lightdm_mock
24from unity8.shell import with_lightdm_mock
24from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
25from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
@@ -40,11 +41,11 @@ class TestLockscreen(UnityTestCase):
40 @with_lightdm_mock("single-pin")
41 @with_lightdm_mock("single-pin")
41 def test_can_unlock_pin_screen(self):
42 def test_can_unlock_pin_screen(self):
42 """Must be able to unlock the PIN entry lock screen."""
43 """Must be able to unlock the PIN entry lock screen."""
43− self.launch_unity()
44+ unity_proxy = self.launch_unity()
44 greeter = self.main_window.get_greeter()
45 greeter = self.main_window.get_greeter()
46 if greeter.narrowMode:
47 if greeter.narrowMode:
47− greeter.swipe()
48+ unlock_unity(unity_proxy)
48 lockscreen = self._wait_for_lockscreen()
49 lockscreen = self._wait_for_lockscreen()
49 self._enter_pincode("1234")
50 self._enter_pincode("1234")
50 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
51 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -55,11 +56,11 @@ class TestLockscreen(UnityTestCase):
55 @with_lightdm_mock("single-passphrase")
56 @with_lightdm_mock("single-passphrase")
56 def test_can_unlock_passphrase_screen(self):
57 def test_can_unlock_passphrase_screen(self):
57 """Must be able to unlock the passphrase entry screen."""
58 """Must be able to unlock the passphrase entry screen."""
58− self.launch_unity()
59+ unity_proxy = self.launch_unity()
59 greeter = self.main_window.get_greeter()
60 greeter = self.main_window.get_greeter()
61 if greeter.narrowMode:
62 if greeter.narrowMode:
62− greeter.swipe()
63+ unlock_unity(unity_proxy)
63 lockscreen = self._wait_for_lockscreen()
64 lockscreen = self._wait_for_lockscreen()
64 self._enter_pin_passphrase("password")
65 self._enter_pin_passphrase("password")
65 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
66 self.assertThat(lockscreen.shown, Eventually(Equals(False)))
@@ -70,11 +71,11 @@ class TestLockscreen(UnityTestCase):
70 @with_lightdm_mock("single-pin")
71 @with_lightdm_mock("single-pin")
71 def test_pin_screen_wrong_code(self):
72 def test_pin_screen_wrong_code(self):
72 """Entering the wrong pin code must not dismiss the lock screen."""
73 """Entering the wrong pin code must not dismiss the lock screen."""
73− self.launch_unity()
74+ unity_proxy = self.launch_unity()
74 greeter = self.main_window.get_greeter()
75 greeter = self.main_window.get_greeter()
76 if greeter.narrowMode:
77 if greeter.narrowMode:
77− greeter.swipe()
78+ unlock_unity(unity_proxy)
78 lockscreen = self._wait_for_lockscreen()
79 lockscreen = self._wait_for_lockscreen()
79 self._enter_pincode("4321")
80 self._enter_pincode("4321")
80 pinentryField = self.main_window.get_pinentryField()
81 pinentryField = self.main_window.get_pinentryField()
@@ -89,11 +90,11 @@ class TestLockscreen(UnityTestCase):
89 @with_lightdm_mock("single-passphrase")
90 @with_lightdm_mock("single-passphrase")
90 def test_passphrase_screen_wrong_password(self):
91 def test_passphrase_screen_wrong_password(self):
91 """Entering the wrong password must not dismiss the lock screen."""
92 """Entering the wrong password must not dismiss the lock screen."""
92− self.launch_unity()
93+ unity_proxy = self.launch_unity()
93 greeter = self.main_window.get_greeter()
94 greeter = self.main_window.get_greeter()
95 if greeter.narrowMode:
96 if greeter.narrowMode:
96− greeter.swipe()
97+ unlock_unity(unity_proxy)
97 lockscreen = self._wait_for_lockscreen()
98 lockscreen = self._wait_for_lockscreen()
98 self._enter_pin_passphrase("foobar")
99 self._enter_pin_passphrase("foobar")
99 pinentryField = self.main_window.get_pinentryField()
100 pinentryField = self.main_window.get_pinentryField()