@@ -24,8 +24,11 @@ from __future__ import absolute_import
2424import logging
2525import os
2626
27+from autopilot.matchers import Eventually
2728from autopilot.platform import model
29+from testtools.matchers import Equals
2830
31+from unity8 import process_helpers
2932from unity8.application_lifecycle import tests
3033
3134
@@ -86,3 +89,29 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
8689 self.swipe_screen_from_right()
8790
8891 self.assert_current_focused_application(application1_name)
92+
93+ def test_greeter_hides_on_app_open(self):
94+ """Greeter should hide when an app is opened"""
95+ process_helpers.lock_unity()
96+ greeter = self.main_window.get_greeter()
97+ self.assertThat(greeter.created, Eventually(Equals(True)))
98+
99+ application_name = self.launch_fake_app()
100+ self.assertThat(greeter.created, Eventually(Equals(False)))
101+ self.assert_current_focused_application(application_name)
102+
103+ def test_greeter_hides_on_app_focus(self):
104+ """Greeter should hide when an app is re-focused"""
105+ application_name = self.launch_fake_app()
106+ self.assert_current_focused_application(application_name)
107+
108+ self.main_window.show_dash_swiping()
109+ self.assert_current_focused_application('')
110+
111+ process_helpers.lock_unity()
112+ greeter = self.main_window.get_greeter()
113+ self.assertThat(greeter.created, Eventually(Equals(True)))
114+
115+ self.launch_upstart_application(application_name)
116+ self.assertThat(greeter.created, Eventually(Equals(False)))
117+ self.assert_current_focused_application(application_name)