Bug 1293991 - Add remaining process/crash checks for methods of the Marionette class. r?automatedtester
MozReview-Commit-ID: 8FhjkRBxZXR
--- 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.