@@ -21,6 +21,7 @@
22from __future__ import absolute_import
22from __future__ import absolute_import
24+from unity8.process_helpers import unlock_unity
24from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
25from unity8.shell.tests import UnityTestCase, _get_device_emulation_scenarios
26from testtools.matchers import Equals, NotEquals
27from testtools.matchers import Equals, NotEquals
@@ -118,9 +119,8 @@ class InteractiveNotificationBase(NotificationsBase):
119 def test_interactive(self):
120 def test_interactive(self):
120 """Interactive notification must react upon click on itself."""
121 """Interactive notification must react upon click on itself."""
121− self.launch_unity()
122+ unity_proxy = self.launch_unity()
122− greeter = self.main_window.get_greeter()
123+ unlock_unity(unity_proxy)
125 notify_list = self._get_notifications_list()
125 notify_list = self._get_notifications_list()
@@ -158,9 +158,8 @@ class InteractiveNotificationBase(NotificationsBase):
158 def test_sd_incoming_call(self):
158 def test_sd_incoming_call(self):
159 """Rejecting a call should make notification expand and
159 """Rejecting a call should make notification expand and
160 offer more options."""
160 offer more options."""
161− self.launch_unity()
161+ unity_proxy = self.launch_unity()
162− greeter = self.main_window.get_greeter()
162+ unlock_unity(unity_proxy)
165 notify_list = self._get_notifications_list()
164 notify_list = self._get_notifications_list()
@@ -336,9 +335,8 @@ class EphemeralNotificationsTests(NotificationsBase):
337 def test_icon_summary_body(self):
336 def test_icon_summary_body(self):
338 """Notification must display the expected summary and body text."""
337 """Notification must display the expected summary and body text."""
339− self.launch_unity()
338+ unity_proxy = self.launch_unity()
340− greeter = self.main_window.get_greeter()
339+ unlock_unity(unity_proxy)
343 notify_list = self._get_notifications_list()
341 notify_list = self._get_notifications_list()
@@ -377,9 +375,8 @@ class EphemeralNotificationsTests(NotificationsBase):
377 def test_icon_summary(self):
375 def test_icon_summary(self):
378 """Notification must display the expected summary and secondary
376 """Notification must display the expected summary and secondary
380− self.launch_unity()
378+ unity_proxy = self.launch_unity()
381− greeter = self.main_window.get_greeter()
379+ unlock_unity(unity_proxy)
384 notify_list = self._get_notifications_list()
381 notify_list = self._get_notifications_list()
@@ -416,9 +413,8 @@ class EphemeralNotificationsTests(NotificationsBase):
416 def test_urgency_order(self):
413 def test_urgency_order(self):
417 """Notifications must be displayed in order according to their
414 """Notifications must be displayed in order according to their
418 urgency."""
415 urgency."""
419− self.launch_unity()
416+ unity_proxy = self.launch_unity()
420− greeter = self.main_window.get_greeter()
417+ unlock_unity(unity_proxy)
423 notify_list = self._get_notifications_list()
419 notify_list = self._get_notifications_list()
@@ -504,9 +500,8 @@ class EphemeralNotificationsTests(NotificationsBase):
505 def test_summary_and_body(self):
501 def test_summary_and_body(self):
506 """Notification must display the expected summary- and body-text."""
502 """Notification must display the expected summary- and body-text."""
507− self.launch_unity()
503+ unity_proxy = self.launch_unity()
508− greeter = self.main_window.get_greeter()
504+ unlock_unity(unity_proxy)
511 notify_list = self._get_notifications_list()
506 notify_list = self._get_notifications_list()
@@ -518,6 +513,7 @@ class EphemeralNotificationsTests(NotificationsBase):
519 notification = notify_list.wait_select_single(
514 notification = notify_list.wait_select_single(
520 'Notification', objectName='notification1')
515 'Notification', objectName='notification1')
521 self._assert_notification(
517 self._assert_notification(
522 notification,
518 notification,
@@ -529,9 +525,8 @@ class EphemeralNotificationsTests(NotificationsBase):
530 def test_summary_only(self):
526 def test_summary_only(self):
531 """Notification must display only the expected summary-text."""
527 """Notification must display only the expected summary-text."""
532− self.launch_unity()
528+ unity_proxy = self.launch_unity()
533− greeter = self.main_window.get_greeter()
529+ unlock_unity(unity_proxy)
536 notify_list = self._get_notifications_list()
531 notify_list = self._get_notifications_list()
@@ -548,9 +543,8 @@ class EphemeralNotificationsTests(NotificationsBase):
548 def test_update_notification_same_layout(self):
543 def test_update_notification_same_layout(self):
549 """Notification must allow updating its contents while being
544 """Notification must allow updating its contents while being
550 displayed."""
545 displayed."""
551− self.launch_unity()
546+ unity_proxy = self.launch_unity()
552− greeter = self.main_window.get_greeter()
547+ unlock_unity(unity_proxy)
555 notify_list = self._get_notifications_list()
549 notify_list = self._get_notifications_list()
@@ -587,9 +581,8 @@ class EphemeralNotificationsTests(NotificationsBase):
587 def test_update_notification_layout_change(self):
581 def test_update_notification_layout_change(self):
588 """Notification must allow updating its contents and layout while
582 """Notification must allow updating its contents and layout while
589 being displayed."""
583 being displayed."""
590− self.launch_unity()
584+ unity_proxy = self.launch_unity()
591− greeter = self.main_window.get_greeter()
585+ unlock_unity(unity_proxy)
594 notify_list = self._get_notifications_list()
587 notify_list = self._get_notifications_list()
@@ -612,6 +605,7 @@ class EphemeralNotificationsTests(NotificationsBase):
613 get_notification = lambda: notify_list.wait_select_single(
606 get_notification = lambda: notify_list.wait_select_single(
614 'Notification', objectName='notification1')
607 'Notification', objectName='notification1')
615 self._assert_notification(
609 self._assert_notification(
616 get_notification(),
610 get_notification(),
@@ -633,9 +627,8 @@ class EphemeralNotificationsTests(NotificationsBase):
634 def test_append_hint(self):
628 def test_append_hint(self):
635 """Notification has to accumulate body-text using append-hint."""
629 """Notification has to accumulate body-text using append-hint."""
636− self.launch_unity()
630+ unity_proxy = self.launch_unity()
637− greeter = self.main_window.get_greeter()
631+ unlock_unity(unity_proxy)
640 notify_list = self._get_notifications_list()
633 notify_list = self._get_notifications_list()
@@ -654,6 +647,7 @@ class EphemeralNotificationsTests(NotificationsBase):
655 get_notification = lambda: notify_list.wait_select_single(
648 get_notification = lambda: notify_list.wait_select_single(
656 'Notification', objectName='notification1')
649 'Notification', objectName='notification1')
657 notification = get_notification()
651 notification = get_notification()
658 self._assert_notification(
652 self._assert_notification(
659 notification,
653 notification,
@@ -685,6 +679,7 @@ class EphemeralNotificationsTests(NotificationsBase):
685 hints=[('x-canonical-append', 'true')]
679 hints=[('x-canonical-append', 'true')]
687 notification.show()
681 notification.show()
688 get_notification = lambda: notify_list.wait_select_single(
683 get_notification = lambda: notify_list.wait_select_single(
689 'Notification',
684 'Notification',
690 objectName='notification1'
685 objectName='notification1'