Index: trunk/src/tools/telemetry/telemetry/core/backends/adb_commands.py |
=================================================================== |
--- trunk/src/tools/telemetry/telemetry/core/backends/adb_commands.py (revision 222006) |
+++ trunk/src/tools/telemetry/telemetry/core/backends/adb_commands.py (working copy) |
@@ -14,7 +14,7 @@ |
util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android') |
try: |
from pylib import android_commands # pylint: disable=F0401 |
- from pylib import constants # pylint: disable=F0401 |
+ from pylib import cmd_helper # pylint: disable=F0401 |
from pylib import forwarder # pylint: disable=F0401 |
from pylib import ports # pylint: disable=F0401 |
except Exception: |
@@ -41,6 +41,10 @@ |
return ports.ResetTestServerPortAllocation() |
+def GetOutDirectory(): |
+ return cmd_helper.OutDirectory.get() |
+ |
+ |
class AdbCommands(object): |
"""A thin wrapper around ADB""" |
@@ -147,11 +151,10 @@ |
if not buildtype: |
return (HasForwarder(buildtype='Release') or |
HasForwarder(buildtype='Debug')) |
- 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) |
+ return (os.path.exists(os.path.join(GetOutDirectory(), buildtype, |
+ 'device_forwarder')) and |
+ os.path.exists(os.path.join(GetOutDirectory(), buildtype, |
+ 'host_forwarder'))) |
class Forwarder(object): |
def __init__(self, adb, *port_pairs): |
@@ -162,12 +165,6 @@ |
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 |