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

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

Issue 18907002: Reland r210268: "Improve forwarder2 setup/tear down in telemetry." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « build/android/pylib/forwarder.py ('k') | tools/telemetry/telemetry/core/chrome/android_browser_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8c2afd24755350fceb7fde6a8cc6e4c4cfbe51e4..3cf3ac3174d4ac194b63bf34ec6b83eac0568c25 100644
--- a/tools/telemetry/telemetry/core/chrome/adb_commands.py
+++ b/tools/telemetry/telemetry/core/chrome/adb_commands.py
@@ -156,19 +156,28 @@ def HasForwarder(buildtype=None):
class Forwarder(object):
def __init__(self, adb, *port_pairs):
- assert HasForwarder()
tool = valgrind_tools.BaseTool()
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]
- buildtype = 'Debug'
- if HasForwarder('Release'):
- buildtype = 'Release'
- self._forwarder = forwarder.Forwarder(adb.Adb(), buildtype)
+ self._forwarder = forwarder.Forwarder(adb.Adb(), Forwarder._GetBuildType())
self._forwarder.Run(new_port_pairs, tool)
+ @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
« no previous file with comments | « build/android/pylib/forwarder.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