@@ -21,6 +21,7 @@
2121
2222from __future__ import absolute_import
2323
24+from unity8.process_helpers import unlock_unity
2425from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
2526
2627from testtools.matchers import Equals, NotEquals
@@ -118,9 +119,8 @@ class InteractiveNotificationBase(NotificationsBase):
118119
119120 def test_interactive(self):
120121 """Interactive notification must react upon click on itself."""
121− self.launch_unity()
122− greeter = self.main_window.get_greeter()
123− greeter.swipe()
122+ unity_proxy = self.launch_unity()
123+ unlock_unity(unity_proxy)
124124
125125 notify_list = self._get_notifications_list()
126126
@@ -158,9 +158,8 @@ class InteractiveNotificationBase(NotificationsBase):
158158 def test_sd_incoming_call(self):
159159 """Rejecting a call should make notification expand and
160160 offer more options."""
161− self.launch_unity()
162− greeter = self.main_window.get_greeter()
163− greeter.swipe()
161+ unity_proxy = self.launch_unity()
162+ unlock_unity(unity_proxy)
164163
165164 notify_list = self._get_notifications_list()
166165
@@ -336,9 +335,8 @@ class EphemeralNotificationsTests(NotificationsBase):
336335
337336 def test_icon_summary_body(self):
338337 """Notification must display the expected summary and body text."""
339− self.launch_unity()
340− greeter = self.main_window.get_greeter()
341− greeter.swipe()
338+ unity_proxy = self.launch_unity()
339+ unlock_unity(unity_proxy)
342340
343341 notify_list = self._get_notifications_list()
344342
@@ -377,9 +375,8 @@ class EphemeralNotificationsTests(NotificationsBase):
377375 def test_icon_summary(self):
378376 """Notification must display the expected summary and secondary
379377 icon."""
380− self.launch_unity()
381− greeter = self.main_window.get_greeter()
382− greeter.swipe()
378+ unity_proxy = self.launch_unity()
379+ unlock_unity(unity_proxy)
383380
384381 notify_list = self._get_notifications_list()
385382
@@ -416,9 +413,8 @@ class EphemeralNotificationsTests(NotificationsBase):
416413 def test_urgency_order(self):
417414 """Notifications must be displayed in order according to their
418415 urgency."""
419− self.launch_unity()
420− greeter = self.main_window.get_greeter()
421− greeter.swipe()
416+ unity_proxy = self.launch_unity()
417+ unlock_unity(unity_proxy)
422418
423419 notify_list = self._get_notifications_list()
424420
@@ -504,9 +500,8 @@ class EphemeralNotificationsTests(NotificationsBase):
504500
505501 def test_summary_and_body(self):
506502 """Notification must display the expected summary- and body-text."""
507− self.launch_unity()
508− greeter = self.main_window.get_greeter()
509− greeter.swipe()
503+ unity_proxy = self.launch_unity()
504+ unlock_unity(unity_proxy)
510505
511506 notify_list = self._get_notifications_list()
512507
@@ -518,6 +513,7 @@ class EphemeralNotificationsTests(NotificationsBase):
518513
519514 notification = notify_list.wait_select_single(
520515 'Notification', objectName='notification1')
516+
521517 self._assert_notification(
522518 notification,
523519 summary,
@@ -529,9 +525,8 @@ class EphemeralNotificationsTests(NotificationsBase):
529525
530526 def test_summary_only(self):
531527 """Notification must display only the expected summary-text."""
532− self.launch_unity()
533− greeter = self.main_window.get_greeter()
534− greeter.swipe()
528+ unity_proxy = self.launch_unity()
529+ unlock_unity(unity_proxy)
535530
536531 notify_list = self._get_notifications_list()
537532
@@ -548,9 +543,8 @@ class EphemeralNotificationsTests(NotificationsBase):
548543 def test_update_notification_same_layout(self):
549544 """Notification must allow updating its contents while being
550545 displayed."""
551− self.launch_unity()
552− greeter = self.main_window.get_greeter()
553− greeter.swipe()
546+ unity_proxy = self.launch_unity()
547+ unlock_unity(unity_proxy)
554548
555549 notify_list = self._get_notifications_list()
556550
@@ -587,9 +581,8 @@ class EphemeralNotificationsTests(NotificationsBase):
587581 def test_update_notification_layout_change(self):
588582 """Notification must allow updating its contents and layout while
589583 being displayed."""
590− self.launch_unity()
591− greeter = self.main_window.get_greeter()
592− greeter.swipe()
584+ unity_proxy = self.launch_unity()
585+ unlock_unity(unity_proxy)
593586
594587 notify_list = self._get_notifications_list()
595588
@@ -612,6 +605,7 @@ class EphemeralNotificationsTests(NotificationsBase):
612605
613606 get_notification = lambda: notify_list.wait_select_single(
614607 'Notification', objectName='notification1')
608+
615609 self._assert_notification(
616610 get_notification(),
617611 summary,
@@ -633,9 +627,8 @@ class EphemeralNotificationsTests(NotificationsBase):
633627
634628 def test_append_hint(self):
635629 """Notification has to accumulate body-text using append-hint."""
636− self.launch_unity()
637− greeter = self.main_window.get_greeter()
638− greeter.swipe()
630+ unity_proxy = self.launch_unity()
631+ unlock_unity(unity_proxy)
639632
640633 notify_list = self._get_notifications_list()
641634
@@ -654,6 +647,7 @@ class EphemeralNotificationsTests(NotificationsBase):
654647
655648 get_notification = lambda: notify_list.wait_select_single(
656649 'Notification', objectName='notification1')
650+
657651 notification = get_notification()
658652 self._assert_notification(
659653 notification,
@@ -685,6 +679,7 @@ class EphemeralNotificationsTests(NotificationsBase):
685679 hints=[('x-canonical-append', 'true')]
686680 )
687681 notification.show()
682+
688683 get_notification = lambda: notify_list.wait_select_single(
689684 'Notification',
690685 objectName='notification1'