зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1275608 - [mozrunner] Remove wait_for_system_message from Emulator; r=ahal
This code is no longer used by Marionette client or elsewhere. MozReview-Commit-ID: 4lx9CN7XIeH --HG-- extra : rebase_source : e0a895c02939c51ee40be5be5f999cc41420a2a7
This commit is contained in:
Родитель
3ff44ada49
Коммит
cada490dd5
|
@ -17,7 +17,6 @@ from .base import Device
|
|||
from .emulator_battery import EmulatorBattery
|
||||
from .emulator_geo import EmulatorGeo
|
||||
from .emulator_screen import EmulatorScreen
|
||||
from ..utils import uses_marionette
|
||||
from ..errors import TimeoutException
|
||||
|
||||
class ArchContext(object):
|
||||
|
@ -175,37 +174,6 @@ class Emulator(Device):
|
|||
self.userdata.close()
|
||||
shutil.rmtree(self.tmpdir)
|
||||
|
||||
# TODO this function is B2G specific and shouldn't live here
|
||||
@uses_marionette
|
||||
def wait_for_system_message(self, marionette):
|
||||
marionette.set_script_timeout(45000)
|
||||
# Telephony API's won't be available immediately upon emulator
|
||||
# boot; we have to wait for the syste-message-listener-ready
|
||||
# message before we'll be able to use them successfully. See
|
||||
# bug 792647.
|
||||
print 'waiting for system-message-listener-ready...'
|
||||
try:
|
||||
marionette.execute_async_script("""
|
||||
waitFor(
|
||||
function() { marionetteScriptFinished(true); },
|
||||
function() { return isSystemMessageListenerReady(); }
|
||||
);
|
||||
""")
|
||||
except:
|
||||
# Look for ScriptTimeoutException this way to avoid a
|
||||
# dependency on the marionette python client.
|
||||
exc_name = sys.exc_info()[0].__name__
|
||||
if exc_name != 'ScriptTimeoutException':
|
||||
raise
|
||||
|
||||
print 'timed out'
|
||||
# We silently ignore the timeout if it occurs, since
|
||||
# isSystemMessageListenerReady() isn't available on
|
||||
# older emulators. 45s *should* be enough of a delay
|
||||
# to allow telephony API's to work.
|
||||
pass
|
||||
print '...done'
|
||||
|
||||
def _get_telnet_response(self, command=None):
|
||||
output = []
|
||||
assert(self.telnet)
|
||||
|
|
|
@ -74,27 +74,6 @@ def _find_marionette_in_args(*args, **kwargs):
|
|||
raise
|
||||
return m
|
||||
|
||||
def uses_marionette(func):
|
||||
"""Decorator which creates a marionette session and deletes it
|
||||
afterwards if one doesn't already exist.
|
||||
"""
|
||||
@wraps(func)
|
||||
def _(*args, **kwargs):
|
||||
m = _find_marionette_in_args(*args, **kwargs)
|
||||
delete_session = False
|
||||
if not m.session:
|
||||
delete_session = True
|
||||
m.start_session()
|
||||
|
||||
m.set_context(m.CONTEXT_CHROME)
|
||||
ret = func(*args, **kwargs)
|
||||
|
||||
if delete_session:
|
||||
m.delete_session()
|
||||
|
||||
return ret
|
||||
return _
|
||||
|
||||
|
||||
def _raw_log():
|
||||
import logging
|
||||
|
|
Загрузка…
Ссылка в новой задаче