Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Unified Diff: tools/telemetry/telemetry/core/forwarders/__init__.py

Issue 640133002: [Telemetry] Properly chose an available device port. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@port
Patch Set: Fix device port unmapping Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/forwarders/android_forwarder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/forwarders/__init__.py
diff --git a/tools/telemetry/telemetry/core/forwarders/__init__.py b/tools/telemetry/telemetry/core/forwarders/__init__.py
index 71962736995fd4106da77aeb92f6bc3661f82e23..748f7bbb610033256e24c7f330dc7e9df369f909 100644
--- a/tools/telemetry/telemetry/core/forwarders/__init__.py
+++ b/tools/telemetry/telemetry/core/forwarders/__init__.py
@@ -33,7 +33,9 @@ class Forwarder(object):
def __init__(self, port_pairs):
assert port_pairs.http, 'HTTP port mapping is required.'
- self._port_pairs = port_pairs
+ self._port_pairs = PortPairs(*[
+ PortPair(p.local_port, p.remote_port or p.local_port)
+ if p else None for p in port_pairs])
@property
def host_port(self):
@@ -44,6 +46,10 @@ class Forwarder(object):
return '127.0.0.1'
@property
+ def port_pairs(self):
+ return self._port_pairs
+
+ @property
def url(self):
assert self.host_ip and self.host_port
return 'http://%s:%i' % (self.host_ip, self.host_port)
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/forwarders/android_forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698