Bug 1320643 - Use device manager directly when forwarding Marionette port; r=whimboo

The `mozrunner.devices.base.setup_port_forwarding` function adds extra
complexity if the `local_port` argument is undefined which we do not
need here.

MozReview-Commit-ID: GSAgTT9nlmK

--HG--
extra : rebase_source : 80a2b1266808eda14d579bebc27cf9a47628a168
This commit is contained in:
Andreas Tolfsen 2016-12-02 17:30:00 +00:00
Родитель 5379f7712e
Коммит 9e5f177093
1 изменённых файлов: 6 добавлений и 6 удалений

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

@ -338,10 +338,11 @@ class FennecInstance(GeckoInstance):
else:
logcat_args["logfile"] = self.gecko_log
self.runner.device.start_logcat(**logcat_args)
self.runner.device.setup_port_forwarding(
local_port=self.marionette_port,
remote_port=self.marionette_port,
)
# forward marionette port (localhost:2828)
self.runner.device.dm.forward(
local="tcp:{}".format(self.marionette_port),
remote="tcp:{}".format(self.marionette_port))
def _get_runner_args(self):
process_args = {
@ -369,8 +370,7 @@ class FennecInstance(GeckoInstance):
super(FennecInstance, self).close(restart)
if self.runner and self.runner.device.connected:
self.runner.device.dm.remove_forward(
"tcp:{}".format(int(self.marionette_port))
)
"tcp:{}".format(self.marionette_port))
class DesktopInstance(GeckoInstance):