本文整理汇总了Python中client.MarionetteClient.connect方法的典型用法代码示例。如果您正苦于以下问题:Python MarionetteClient.connect方法的具体用法?Python MarionetteClient.connect怎么用?Python MarionetteClient.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client.MarionetteClient
的用法示例。
在下文中一共展示了MarionetteClient.connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: connect
# 需要导入模块: from client import MarionetteClient [as 别名]
# 或者: from client.MarionetteClient import connect [as 别名]
def connect(self):
""" When using ADB port forwarding, the ADB server will actually accept
connections even though there isn't a listening socket open on the
device. Here we add a retry loop since we have to restart the debug
server / b2g process for update tests
"""
for i in range(self.MAX_RETRIES):
try:
MarionetteClient.connect(self, timeout=self.CONNECT_TIMEOUT)
break
except:
if i == self.MAX_RETRIES - 1:
raise
time.sleep(self.RETRY_TIMEOUT)
self.runner.port_forward()
# Upon success, reset the socket timeout to something more reasonable
self.sock.settimeout(self.SEND_TIMEOUT)