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

Unified Diff: tools/telemetry/telemetry/cros_interface_unittest.py

Issue 11348217: [telemetry] Removing flake in wpr_server.py caused by static port assignment from chrome/test/funct… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move away from pylib Created 7 years, 11 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 | « tools/telemetry/telemetry/cros_interface.py ('k') | tools/telemetry/telemetry/temporary_http_server.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/cros_interface_unittest.py
diff --git a/tools/telemetry/telemetry/cros_interface_unittest.py b/tools/telemetry/telemetry/cros_interface_unittest.py
index 44b2a792b7f5c03616703a941d381edc9acd8bfc..d65cc55aa669593d2cc002eeb65e43bbb1868bdb 100644
--- a/tools/telemetry/telemetry/cros_interface_unittest.py
+++ b/tools/telemetry/telemetry/cros_interface_unittest.py
@@ -12,6 +12,7 @@ from telemetry import cros_browser_backend
from telemetry import cros_interface
from telemetry import options_for_unittests
from telemetry import run_tests
+from telemetry import util
class CrOSInterfaceTest(unittest.TestCase):
@run_tests.RequiresBrowserOfType('cros-chrome')
@@ -130,7 +131,7 @@ class CrOSInterfaceTest(unittest.TestCase):
# Forward local server's port to remote device's remote_port.
forwarder = cros_browser_backend.SSHForwarder(
- cri, 'R', (remote_port, port))
+ cri, 'R', util.PortPair(port, remote_port))
# At this point, remote device should be able to connect to local server.
self.assertTrue(cri.IsHTTPServerRunningOnPort(remote_port))
@@ -146,3 +147,17 @@ class CrOSInterfaceTest(unittest.TestCase):
# Device should no longer be able to connect to remote_port since it is no
# longer in use.
self.assertFalse(cri.IsHTTPServerRunningOnPort(remote_port))
+
+ @run_tests.RequiresBrowserOfType('cros-chrome')
+ def testGetRemotePortReservedPorts(self):
+ remote = options_for_unittests.GetCopy().cros_remote
+ cri = cros_interface.CrOSInterface(
+ remote,
+ options_for_unittests.GetCopy().cros_ssh_identity)
+
+ # Should return 2 separate ports even though the first one isn't technically
+ # being used yet.
+ remote_port_1 = cri.GetRemotePort()
+ remote_port_2 = cri.GetRemotePort()
+
+ self.assertTrue(remote_port_1 != remote_port_2)
« no previous file with comments | « tools/telemetry/telemetry/cros_interface.py ('k') | tools/telemetry/telemetry/temporary_http_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698