Index: build/android/pylib/instrumentation/test_runner.py |
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py |
index b4ad7f44ddf20449c1fc2dc06e3a89d5e86ca799..c29a381e4c29605f3890fa4878701f244f60357a 100644 |
--- a/build/android/pylib/instrumentation/test_runner.py |
+++ b/build/android/pylib/instrumentation/test_runner.py |
@@ -151,11 +151,13 @@ class TestRunner(base_test_runner.BaseTestRunner): |
http_server_ports = self.LaunchTestHttpServer( |
os.path.join(constants.DIR_SOURCE_ROOT), self._lighttp_port) |
if self.ports_to_forward: |
- self.StartForwarder([(port, port) for port in self.ports_to_forward]) |
+ self.ForwardPorts([(port, port) for port in self.ports_to_forward]) |
self.flags.AddFlags(['--enable-test-intents']) |
def TearDown(self): |
"""Cleans up the test harness and saves outstanding data from test run.""" |
+ if self.ports_to_forward: |
+ self._UnmapPorts([(port, port) for port in self.ports_to_forward]) |
super(TestRunner, self).TearDown() |
def TestSetup(self, test): |
@@ -169,7 +171,7 @@ class TestRunner(base_test_runner.BaseTestRunner): |
self.tool.SetupEnvironment() |
# Make sure the forwarder is still running. |
- self.RestartHttpServerForwarderIfNecessary() |
+ self._RestartHttpServerForwarderIfNecessary() |
def _IsPerfTest(self, test): |
"""Determines whether a test is a performance test. |