summaryrefslogtreecommitdiffstats
path: root/build/android/pylib/instrumentation/test_runner.py
diff options
context:
space:
mode:
authorjbudorick <jbudorick@chromium.org>2015-02-03 11:38:38 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-03 19:39:29 +0000
commit7103545f9756c669cf3d29085658f9fb159a0d18 (patch)
tree9081504a371e5b4596a14ac7db2e7d83f95f3d05 /build/android/pylib/instrumentation/test_runner.py
parentff49cf31bc0e2c4c56e330a978a9f9599d75c6ab (diff)
downloadchromium_src-7103545f9756c669cf3d29085658f9fb159a0d18.zip
chromium_src-7103545f9756c669cf3d29085658f9fb159a0d18.tar.gz
chromium_src-7103545f9756c669cf3d29085658f9fb159a0d18.tar.bz2
[Android] Add LogcatMonitor.
LogcatMonitor provides the same functionality as AndroidCommands.WaitForLogMatch and the associated functions. BUG=267773 Review URL: https://codereview.chromium.org/896503002 Cr-Commit-Position: refs/heads/master@{#314384}
Diffstat (limited to 'build/android/pylib/instrumentation/test_runner.py')
-rw-r--r--build/android/pylib/instrumentation/test_runner.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index 424dcb3..fb9557e 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -51,6 +51,7 @@ class TestRunner(base_test_runner.BaseTestRunner):
super(TestRunner, self).__init__(device, test_options.tool,
test_options.cleanup_test_files)
self._lighttp_port = constants.LIGHTTPD_RANDOM_PORT_FIRST + shard_index
+ self._logcat_monitor = None
self.coverage_device_file = None
self.coverage_dir = test_options.coverage_dir
@@ -174,9 +175,10 @@ class TestRunner(base_test_runner.BaseTestRunner):
"""
if not self._IsPerfTest(test):
return
- self.device.old_interface.Adb().SendCommand(
- 'shell rm ' + TestRunner._DEVICE_PERF_OUTPUT_SEARCH_PREFIX)
- self.device.old_interface.StartMonitoringLogcat()
+ self.device.RunShellCommand(
+ ['rm', TestRunner._DEVICE_PERF_OUTPUT_SEARCH_PREFIX])
+ self._logcat_monitor = self.device.GetLogcatMonitor()
+ self._logcat_monitor.Start()
def TestTeardown(self, test, result):
"""Cleans up the test harness after running a particular test.
@@ -219,9 +221,8 @@ class TestRunner(base_test_runner.BaseTestRunner):
raw_test_name = test.split('#')[1]
# Wait and grab annotation data so we can figure out which traces to parse
- regex = self.device.old_interface.WaitForLogMatch(
- re.compile(r'\*\*PERFANNOTATION\(' + raw_test_name + r'\)\:(.*)'),
- None)
+ regex = self._logcat_monitor.WaitFor(
+ re.compile(r'\*\*PERFANNOTATION\(' + raw_test_name + r'\)\:(.*)'))
# If the test is set to run on a specific device type only (IE: only
# tablet or phone) and it is being run on the wrong device, the test