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

Unified Diff: build/android/pylib/gtest/test_package_apk.py

Issue 1290773009: [Android] Remove android_commands and android_testrunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: msg3: sullivan comment Created 5 years, 4 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/device/device_utils_test.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/gtest/test_package_apk.py
diff --git a/build/android/pylib/gtest/test_package_apk.py b/build/android/pylib/gtest/test_package_apk.py
index b67cef1f16f651359d8c2ee5b50f6c2757119aaa..1bf391376c53c7d468deba9e33ac3596d3547139 100644
--- a/build/android/pylib/gtest/test_package_apk.py
+++ b/build/android/pylib/gtest/test_package_apk.py
@@ -14,7 +14,6 @@ import sys
import tempfile
import time
-from pylib import android_commands
from pylib import constants
from pylib import pexpect
from pylib.device import device_errors
@@ -71,8 +70,7 @@ class TestPackageApk(TestPackage):
else:
raise device_errors.DeviceUnreachableError(
'Unable to find fifo on device %s ' % self._GetFifo())
- args = shlex.split(device.old_interface.Adb()._target_arg)
- args += ['shell', 'cat', self._GetFifo()]
+ args = ['-s', device.adb.GetDeviceSerial(), 'shell', 'cat', self._GetFifo()]
return pexpect.spawn('adb', args, timeout=timeout, logfile=logfile)
def _StartActivity(self, device, force_stop=True):
@@ -143,9 +141,20 @@ class TestPackageApk(TestPackage):
self._StartActivity(device, force_stop=False)
finally:
self.tool.CleanUpEnvironment()
- logfile = android_commands.NewLineNormalizer(sys.stdout)
+ logfile = self._NewLineNormalizer(sys.stdout)
return self._WatchFifo(device, timeout=10, logfile=logfile)
+ class _NewLineNormalizer(object):
+ def __init__(self, output):
+ self._output = output
+
+ def write(self, data):
+ data = data.replace('\r\r\n', '\n')
+ self._output.write(data)
+
+ def flush(self):
+ self._output.flush()
+
#override
def Install(self, device):
self.tool.CopyFiles(device)
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/instrumentation/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698