Bug 1293991 - Add remaining process/crash checks for methods of the Marionette class. r=automatedtester
authorHenrik Skupin <mail@hskupin.info>
Wed, 10 Aug 2016 14:18:37 +0200
changeset 400361 903c21dc14819a9ccc6da3f9b65db73623db41b3
parent 400360 b4e9c7e20cf8d7adfb15df7cc4bc4fc84fccc8ba
child 400362 2c02455213eecaf863b7214baa608e19f8b248a3
push id26138
push usergszorc@mozilla.com
push dateSat, 13 Aug 2016 03:04:36 +0000
reviewersautomatedtester
bugs1293991
milestone51.0a1
Bug 1293991 - Add remaining process/crash checks for methods of the Marionette class. r=automatedtester MozReview-Commit-ID: 8FhjkRBxZXR
testing/marionette/client/marionette_driver/marionette.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -984,16 +984,17 @@ class Marionette(object):
         original_prefs = {p: self.get_pref(p) for p in prefs}
         self.set_prefs(prefs)
 
         try:
             yield
         finally:
             self.set_prefs(original_prefs)
 
+    @do_process_check
     def enforce_gecko_prefs(self, prefs):
         """
         Checks if the running instance has the given prefs. If not, it will kill the
         currently running instance, and spawn a new instance with the requested preferences.
 
         : param prefs: A dictionary whose keys are preference names.
         """
         if not self.instance:
@@ -1051,16 +1052,17 @@ class Marionette(object):
         try:
             self.raise_for_port(self.wait_for_port())
         except socket.timeout:
             if self.instance.runner.returncode is not None:
                 exc, val, tb = sys.exc_info()
                 self.cleanup()
                 raise exc, 'Requested restart of the application was aborted', tb
 
+    @do_process_check
     def restart(self, clean=False, in_app=False):
         """
         This will terminate the currently running instance, and spawn a new instance
         with the same profile and then reuse the session id when creating a session again.
 
         : param clean: If False the same profile will be used after the restart. Note
                        that the in app initiated restart always maintains the same
                        profile.