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

Unified Diff: tools/telemetry/telemetry/core/chrome/adb_commands.py

Issue 20824008: Reland r212020: Move Python setup/tear down logic into Forwarder ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Close unused FDs Created 7 years, 5 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
Index: tools/telemetry/telemetry/core/chrome/adb_commands.py
diff --git a/tools/telemetry/telemetry/core/chrome/adb_commands.py b/tools/telemetry/telemetry/core/chrome/adb_commands.py
index e18e667d35717f5dc74cd69fd0437758c1b1d269..890327bf19eb273a4c97d9f590b86ae327c0907f 100644
--- a/tools/telemetry/telemetry/core/chrome/adb_commands.py
+++ b/tools/telemetry/telemetry/core/chrome/adb_commands.py
@@ -20,7 +20,6 @@ try:
from pylib import cmd_helper # pylint: disable=F0401
from pylib import forwarder # pylint: disable=F0401
from pylib import ports # pylint: disable=F0401
- from pylib import valgrind_tools # pylint: disable=F0401
except Exception:
android_commands = None
@@ -160,34 +159,24 @@ def HasForwarder(buildtype=None):
class Forwarder(object):
def __init__(self, adb, *port_pairs):
- tool = valgrind_tools.BaseTool()
+ self._adb = adb.Adb()
self._host_port = port_pairs[0].local_port
new_port_pairs = [(port_pair.local_port, port_pair.remote_port)
for port_pair in port_pairs]
- self._forwarder = forwarder.Forwarder(adb.Adb(), Forwarder._GetBuildType())
- self._forwarder.Run(new_port_pairs, tool)
+ self._port_pairs = new_port_pairs
+ forwarder.Forwarder.Map(new_port_pairs, self._adb)
@staticmethod
def _GetBuildType():
assert HasForwarder()
return 'Debug' if HasForwarder('Debug') else 'Release'
- @staticmethod
- def KillHost():
- forwarder.Forwarder.KillHost(Forwarder._GetBuildType())
-
- @staticmethod
- def KillDevice(adb):
- forwarder.Forwarder.KillDevice(adb.Adb(), valgrind_tools.BaseTool())
-
@property
def url(self):
- assert self._forwarder
return 'http://localhost:%i' % self._host_port
def Close(self):
- if self._forwarder:
- self._forwarder.Close()
- self._forwarder = None
+ for (device_port, _) in self._port_pairs:
+ forwarder.Forwarder.UnmapDevicePort(device_port, self._adb)
« no previous file with comments | « chrome/test/chromedriver/test_environment.py ('k') | tools/telemetry/telemetry/core/chrome/android_browser_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698