@@ -24,8 +24,11 @@ from __future__ import absolute_import
24import logging
24import logging
27+from autopilot.matchers import Eventually
27from autopilot.platform import model
28from autopilot.platform import model
29+from testtools.matchers import Equals
31+from unity8 import process_helpers
29from unity8.application_lifecycle import tests
32from unity8.application_lifecycle import tests
@@ -86,3 +89,29 @@ class ApplicationLifecycleTests(tests.ApplicationLifeCycleTestCase):
86 self.swipe_screen_from_right()
89 self.swipe_screen_from_right()
88 self.assert_current_focused_application(application1_name)
91 self.assert_current_focused_application(application1_name)
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)))
99+ application_name = self.launch_fake_app()
100+ self.assertThat(greeter.created, Eventually(Equals(False)))
101+ self.assert_current_focused_application(application_name)
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)
108+ self.main_window.show_dash_swiping()
109+ self.assert_current_focused_application('')
111+ process_helpers.lock_unity()
112+ greeter = self.main_window.get_greeter()
113+ self.assertThat(greeter.created, Eventually(Equals(True)))
115+ self.launch_upstart_application(application_name)
116+ self.assertThat(greeter.created, Eventually(Equals(False)))
117+ self.assert_current_focused_application(application_name)