Bug 1293991 - Add remaining process/crash checks for methods of the Marionette class. r?automatedtester draft
authorHenrik Skupin <mail@hskupin.info>
Wed, 10 Aug 2016 14:18:37 +0200
changeset 399883 03124cbde3b4cc54432f9c2383a7feb300877fae
parent 398604 6cf0089510fad8deb866136f5b92bbced9498447
child 528089 1293313b13fb324bb99b297b0fcd01398be4d9e4
push id26024
push userbmo:hskupin@gmail.com
push dateFri, 12 Aug 2016 09:01:27 +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.