| Index: build/android/pylib/remote/device/remote_device_test_run.py
|
| diff --git a/build/android/pylib/remote/device/remote_device_test_run.py b/build/android/pylib/remote/device/remote_device_test_run.py
|
| index 5bfbc4f7740beba8f8616ebfab0291593d9276d7..6ccfc88114620f5163a0c4310548f2c501728d43 100644
|
| --- a/build/android/pylib/remote/device/remote_device_test_run.py
|
| +++ b/build/android/pylib/remote/device/remote_device_test_run.py
|
| @@ -7,6 +7,7 @@
|
| import json
|
| import logging
|
| import os
|
| +import re
|
| import shutil
|
| import string
|
| import tempfile
|
| @@ -19,6 +20,9 @@ from pylib.remote.device import appurify_sanitized
|
| from pylib.remote.device import remote_device_helper
|
| from pylib.utils import zip_utils
|
|
|
| +_DEVICE_OFFLINE_RE = re.compile('error: device not found')
|
| +
|
| +
|
| class RemoteDeviceTestRun(test_run.TestRun):
|
| """Run tests on a remote device."""
|
|
|
| @@ -340,3 +344,18 @@ class RemoteDeviceTestRun(test_run.TestRun):
|
| logging.log(level, line)
|
| except KeyError:
|
| logging.error('No logcat found.')
|
| +
|
| + def _LogAdbTraceLog(self):
|
| + zip_file = self._DownloadTestResults(None)
|
| + with zipfile.ZipFile(zip_file) as z:
|
| + adb_trace_log = z.read('adb_trace.log')
|
| + for line in adb_trace_log.splitlines():
|
| + logging.critical(line)
|
| +
|
| + def _DidDeviceGoOffline(self):
|
| + zip_file = self._DownloadTestResults(None)
|
| + with zipfile.ZipFile(zip_file) as z:
|
| + adb_trace_log = z.read('adb_trace.log')
|
| + if any(_DEVICE_OFFLINE_RE.search(l) for l in adb_trace_log.splitlines()):
|
| + return True
|
| + return False
|
|
|