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

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

Issue 23494039: [android] Relands: Adds constants.GetBuildDirectory() and converts test scripts to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix provision_devices.py which never set the build type Created 7 years, 3 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 | « chrome/test/functional/ispy/ispy_core/tools/reverse_port_forwarder.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/backends/adb_commands.py
diff --git a/tools/telemetry/telemetry/core/backends/adb_commands.py b/tools/telemetry/telemetry/core/backends/adb_commands.py
index bd749e910a4315c61364938328ef6a3ae42f767e..e02a3faf241a5c14696110a5849975290bdd28b3 100644
--- a/tools/telemetry/telemetry/core/backends/adb_commands.py
+++ b/tools/telemetry/telemetry/core/backends/adb_commands.py
@@ -14,7 +14,7 @@ from telemetry.core import util
util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
try:
from pylib import android_commands # pylint: disable=F0401
- from pylib import cmd_helper # pylint: disable=F0401
+ from pylib import constants # pylint: disable=F0401
from pylib import forwarder # pylint: disable=F0401
from pylib import ports # pylint: disable=F0401
except Exception:
@@ -41,10 +41,6 @@ def ResetTestServerPortAllocation():
return ports.ResetTestServerPortAllocation()
-def GetOutDirectory():
- return cmd_helper.OutDirectory.get()
-
-
class AdbCommands(object):
"""A thin wrapper around ADB"""
@@ -151,10 +147,11 @@ def HasForwarder(buildtype=None):
if not buildtype:
return (HasForwarder(buildtype='Release') or
HasForwarder(buildtype='Debug'))
- return (os.path.exists(os.path.join(GetOutDirectory(), buildtype,
- 'device_forwarder')) and
- os.path.exists(os.path.join(GetOutDirectory(), buildtype,
- 'host_forwarder')))
+ device_forwarder = os.path.join(
+ constants.GetOutDirectory(build_type=buildtype), 'device_forwarder')
+ host_forwarder = os.path.join(
+ constants.GetOutDirectory(build_type=buildtype), 'host_forwarder')
+ return os.path.exists(device_forwarder) and os.path.exists(host_forwarder)
class Forwarder(object):
def __init__(self, adb, *port_pairs):
@@ -165,6 +162,12 @@ class Forwarder(object):
for port_pair in port_pairs]
self._port_pairs = new_port_pairs
+ if HasForwarder('Release'):
+ constants.SetBuildType('Release')
+ elif HasForwarder('Debug'):
+ constants.SetBuildType('Debug')
+ else:
+ raise Exception('Build forwarder2')
forwarder.Forwarder.Map(new_port_pairs, self._adb)
@property
« no previous file with comments | « chrome/test/functional/ispy/ispy_core/tools/reverse_port_forwarder.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698