Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #16523 from bobsilverberg/stop_exception
Browse files Browse the repository at this point in the history
Bug 972557 - To address Bug 971747 - Add an exception that will report when b2g cannot be stopped
  • Loading branch information
Zac committed Apr 25, 2014
2 parents 8abb488 + f6a60ee commit 8419ede
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/python/gaia-ui-tests/gaiatest/gaia_test.py
Expand Up @@ -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()
Expand Down

0 comments on commit 8419ede

Please sign in to comment.