summaryrefslogtreecommitdiff
diff options
-rw-r--r--tests/autopilot/autopilot/tests/__init__.py4
-rw-r--r--tests/autopilot/autopilot/tests/test_launcher.py4
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/autopilot/autopilot/tests/__init__.py b/tests/autopilot/autopilot/tests/__init__.py
index d23eb5e33..e8ed05af0 100644
--- a/tests/autopilot/autopilot/tests/__init__.py
+++ b/tests/autopilot/autopilot/tests/__init__.py
@@ -270,14 +270,14 @@ class AutopilotTestCase(VideoCapturedTestCase, KeybindingsHelper):
app = self.KNOWN_APPS[app_name]
self.bamf.launch_application(app['desktop-file'], files)
apps = self.bamf.get_running_applications_by_desktop_file(app['desktop-file'])
- self.addCleanup(call, ["pkill", "-f", app['process-name']])
+ self.addCleanup(call, "kill `pidof %s`" % (app['process-name']), shell=True)
self.assertThat(len(apps), Equals(1))
return apps[0]
def close_all_app(self, app_name):
"""Close all instances of the app_name."""
app = self.KNOWN_APPS[app_name]
- self.addCleanup(call, ["pkill", "-f", app['process-name']])
+ self.addCleanup(call, "kill `pidof %s`" % (app['process-name']), shell=True)
super(LoggedTestCase, self).tearDown()
def get_app_instances(self, app_name):
diff --git a/tests/autopilot/autopilot/tests/test_launcher.py b/tests/autopilot/autopilot/tests/test_launcher.py
index a10f9acc1..e2f625af3 100644
--- a/tests/autopilot/autopilot/tests/test_launcher.py
+++ b/tests/autopilot/autopilot/tests/test_launcher.py
@@ -575,8 +575,10 @@ class LauncherVisualTests(LauncherTestCase):
"""Killing bamfdaemon should not duplicate any launcher icon."""
self.start_app("Calculator")
self.start_app("System Settings")
+ # We launch also xterm without using self.start_app since it's an application
+ # without .desktop file.
os.spawnlp(os.P_NOWAIT, "xterm", "xterm", "-title", "Autopilot XTerm", "-e", "sh")
- self.addCleanup(call, ["killall", "xterm"])
+ self.addCleanup(call, ["pkill", "xterm"])
# FIXME bamf emulator should wait until a window is open
sleep(1)