Bug 1320643 - Use device manager directly when forwarding Marionette port; r=whimboo a=test-only
authorAndreas Tolfsen <ato@mozilla.com>
Fri, 02 Dec 2016 17:30:00 +0000
changeset 352876 4f0a939678a8ab4df672d88011928c8cc8b9aaeb
parent 352875 d3c8c1a41bd773b1bf5a29b3c8066448d53d8ff5
child 352877 469464ff01564cf915217b6f80d755e43e8e12da
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo, test-only
bugs1320643
milestone52.0a2
Bug 1320643 - Use device manager directly when forwarding Marionette port; r=whimboo a=test-only 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
testing/marionette/client/marionette_driver/geckoinstance.py
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -333,20 +333,21 @@ class FennecInstance(GeckoInstance):
             "filterspec": "Gecko",
             "serial": self.runner.device.dm._deviceSerial
         }
         if self.gecko_log == "-":
             logcat_args["stream"] = sys.stdout
         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 = {
             "processOutputLine": [NullOutput()],
         }
 
         runner_args = {
             "app": self.package_name,
@@ -364,18 +365,17 @@ class FennecInstance(GeckoInstance):
             runner_args["avd"] = self.avd
 
         return runner_args
 
     def close(self, restart=False):
         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):
     desktop_prefs = {
         # Disable application updates
         "app.update.enabled": False,
 
         # Enable output of dump()