зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1229765 - Monitor Marionette browser process for start-up crashes; r=automatedtester
--HG-- extra : commitid : J3ZpqBpdzII extra : rebase_source : d892ccda36863cbabb9cc91be3551e3f216b514d extra : histedit_source : 109df2906bb9c387a703e61b5a6ff6dc903fb0f7
This commit is contained in:
Родитель
953c3efe23
Коммит
892672a9c9
|
@ -598,7 +598,7 @@ class Marionette(object):
|
|||
addons=self.addons,
|
||||
workspace=workspace)
|
||||
self.instance.start()
|
||||
assert(self.wait_for_port(timeout=startup_timeout)), "Timed out waiting for port!"
|
||||
self.raise_for_port(self.wait_for_port(timeout=startup_timeout))
|
||||
|
||||
if emulator:
|
||||
self.runner = B2GEmulatorRunner(b2g_home=homedir,
|
||||
|
@ -617,7 +617,7 @@ class Marionette(object):
|
|||
self.emulator = self.runner.device
|
||||
self.emulator.start()
|
||||
self.port = self.emulator.setup_port_forwarding(remote_port=self.port)
|
||||
assert(self.emulator.wait_for_port(self.port)), "Timed out waiting for port!"
|
||||
self.raise_for_port(self.emulator.wait_for_port(self.port))
|
||||
|
||||
if connect_to_running_emulator:
|
||||
self.runner = B2GEmulatorRunner(b2g_home=homedir,
|
||||
|
@ -626,7 +626,7 @@ class Marionette(object):
|
|||
self.emulator = self.runner.device
|
||||
self.emulator.connect()
|
||||
self.port = self.emulator.setup_port_forwarding(remote_port=self.port)
|
||||
assert(self.emulator.wait_for_port(self.port)), "Timed out waiting for port!"
|
||||
self.raise_for_port(self.emulator.wait_for_port(self.port))
|
||||
|
||||
if emulator:
|
||||
if busybox:
|
||||
|
@ -673,6 +673,12 @@ class Marionette(object):
|
|||
def wait_for_port(self, timeout=60):
|
||||
return transport.wait_for_port(self.host, self.port, timeout=timeout)
|
||||
|
||||
@do_crash_check
|
||||
def raise_for_port(self, port_obtained):
|
||||
if not port_obtained:
|
||||
raise IOError("Timed out waiting for port!")
|
||||
|
||||
|
||||
@do_crash_check
|
||||
def _send_message(self, name, params=None, key=None):
|
||||
"""Send a blocking message to the server.
|
||||
|
@ -1097,7 +1103,7 @@ class Marionette(object):
|
|||
if not pref_exists:
|
||||
self.delete_session()
|
||||
self.instance.restart(prefs)
|
||||
assert(self.wait_for_port()), "Timed out waiting for port!"
|
||||
self.raise_for_port(self.wait_for_port())
|
||||
self.start_session()
|
||||
self._reset_timeouts()
|
||||
|
||||
|
@ -1134,7 +1140,7 @@ class Marionette(object):
|
|||
else:
|
||||
self.delete_session()
|
||||
self.instance.restart(clean=clean)
|
||||
assert(self.wait_for_port()), "Timed out waiting for port!"
|
||||
self.raise_for_port(self.wait_for_port())
|
||||
self.start_session(session_id=self.session_id)
|
||||
self._reset_timeouts()
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче