From f6a60eed68ca43cff1ccbec182cadad9a9499330 Mon Sep 17 00:00:00 2001 From: Bob Silverberg Date: Fri, 21 Feb 2014 13:06:25 -0500 Subject: [PATCH] Bug 972557 - To address Bug 971747 - Add an exception that will report when b2g cannot be stopped --- tests/python/gaia-ui-tests/gaiatest/gaia_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/python/gaia-ui-tests/gaiatest/gaia_test.py b/tests/python/gaia-ui-tests/gaiatest/gaia_test.py index 8cf2b7e6ccfb..73b0db1c58ea 100644 --- a/tests/python/gaia-ui-tests/gaiatest/gaia_test.py +++ b/tests/python/gaia-ui-tests/gaiatest/gaia_test.py @@ -723,12 +723,19 @@ def start_b2g(self, timeout=60): self.marionette.import_script(self.lockscreen_atom) self.update_checker.check_updates() - def stop_b2g(self): + @property + def is_b2g_running(self): + return 'b2g' in self.manager.shellCheckOutput(['toolbox', 'ps']) + + def stop_b2g(self, timeout=5): if self.marionette.instance: # close the gecko instance attached to marionette self.marionette.instance.close() elif self.is_android_build: self.manager.shellCheckOutput(['stop', 'b2g']) + Wait(self.marionette, timeout=timeout).until( + lambda m: not self.is_b2g_running, + message='b2g failed to stop.') else: raise Exception('Unable to stop B2G') self.marionette.client.close()