on xenial help sign in
Use upstart to re-focus app, rather than calling it directly; better test of fix
commit5ea1eca1e4598308b51b310d4c16be77fe802c5f authorMichael Terry <michael.terry@canonical.com> dateTue 28 Jan 2014, 11:42 (13 years ago) parent7f71e9d
1 file changed+5−3
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+5−3
tests/autopilot/unity8/application_lifecycle/tests/test_application_lifecycle.py+5−3
@@ -30,6 +30,7 @@ from autopilot.platform import model
3030from testtools.matchers import Equals, NotEquals
3131
3232import logging
33+import subprocess
3334
3435logger = logging.getLogger(__name__)
3536
@@ -163,8 +164,8 @@ class ApplicationLifecycleTests(UnityTestCase):
163164 )
164165
165166 @disable_qml_mocking
166− def test_greeter_hides_on_app_focus(self):
167− """Greeter should hide when an app is re-focused"""
167+ def test_greeter_hides_on_app_focus_via_upstart(self):
168+ """Greeter should hide when an app is re-focused with upstart"""
168169 unity_proxy = self.launch_unity()
169170 unlock_unity(unity_proxy)
170171
@@ -184,7 +185,8 @@ class ApplicationLifecycleTests(UnityTestCase):
184185 greeter = self.main_window.get_greeter()
185186 self.assertThat(greeter.created, Eventually(Equals(True)))
186187
187− app = self._launch_app("messaging-app")
188+ command = ['initctl', 'start', 'application', 'APP_ID=messaging-app']
189+ subprocess.check_call(command)
188190 self.assertThat(greeter.created, Eventually(Equals(False)))
189191 self.assertThat(
190192 self._get_current_focused_app_id(),