Bug 1320643 - Remove Device.setup_port_forward from mozrunner; r=jmaher,whimboo

The only consumer of `mozrunner.devices.base.Device.setup_port_forward`
was Marionette, which now uses `mozdevice.DeviceManagerADB.forward`
directly.

MozReview-Commit-ID: 72ROrOixKvM

--HG--
extra : rebase_source : f998e6c37161f851da450bd98ee27ba04a50f16f
This commit is contained in:
Andreas Tolfsen 2016-12-02 19:49:37 +00:00
Родитель 9e5f177093
Коммит c67b15da93
1 изменённых файлов: 0 добавлений и 19 удалений

Просмотреть файл

@ -186,25 +186,6 @@ class Device(object):
adb.wait() adb.wait()
self.dm._verifyZip() self.dm._verifyZip()
def setup_port_forwarding(self, local_port=None, remote_port=2828):
"""
Set up TCP port forwarding to the specified port on the device,
using any availble local port (if none specified), and return the local port.
:param local_port: The local port to forward from, if unspecified a
random port is chosen.
:param remote_port: The remote port to forward to, defaults to 2828.
:returns: The local_port being forwarded.
"""
if not local_port:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("", 0))
local_port = s.getsockname()[1]
s.close()
self.dm.forward('tcp:%d' % int(local_port), 'tcp:%d' % int(remote_port))
return local_port
def wait_for_net(self): def wait_for_net(self):
active = False active = False
time_out = 0 time_out = 0