on xenial help sign in
Use upstart to re-focus app, rather than calling it directly; better test of fix
5ea1ecaMichael Terry
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+5−3
@@ -30,6 +30,7 @@ from autopilot.platform import model
30from testtools.matchers import Equals, NotEquals
30from testtools.matchers import Equals, NotEquals
31
31
32import logging
32import logging
33+import subprocess
33
34
34logger = logging.getLogger(__name__)
35logger = logging.getLogger(__name__)
35
36
@@ -163,8 +164,8 @@ class ApplicationLifecycleTests(UnityTestCase):
163 )
164 )
164
165
165 @disable_qml_mocking
166 @disable_qml_mocking
166− def test_greeter_hides_on_app_focus(self):
167+ def test_greeter_hides_on_app_focus_via_upstart(self):
167− """Greeter should hide when an app is re-focused"""
168+ """Greeter should hide when an app is re-focused with upstart"""
168 unity_proxy = self.launch_unity()
169 unity_proxy = self.launch_unity()
169 unlock_unity(unity_proxy)
170 unlock_unity(unity_proxy)
170
171
@@ -184,7 +185,8 @@ class ApplicationLifecycleTests(UnityTestCase):
184 greeter = self.main_window.get_greeter()
185 greeter = self.main_window.get_greeter()
185 self.assertThat(greeter.created, Eventually(Equals(True)))
186 self.assertThat(greeter.created, Eventually(Equals(True)))
186
187
187− app = self._launch_app("messaging-app")
188+ command = ['initctl', 'start', 'application', 'APP_ID=messaging-app']
189+ subprocess.check_call(command)
188 self.assertThat(greeter.created, Eventually(Equals(False)))
190 self.assertThat(greeter.created, Eventually(Equals(False)))
189 self.assertThat(
191 self.assertThat(
190 self._get_current_focused_app_id(),
192 self._get_current_focused_app_id(),