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

Unified Diff: build/android/pylib/remote/device/remote_device_test_run.py

Issue 1277943002: [Android] Detect when remote service loses contact with device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/remote/device/remote_device_gtest_run.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..03c16ed7af5359ff5eb6117b8ce7ba843617c52c 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
@@ -336,7 +337,22 @@ class RemoteDeviceTestRun(test_run.TestRun):
try:
logcat = z.read('appurify_results/logcat.txt')
printable_logcat = ''.join(c for c in logcat if c in string.printable)
+ logging.log(level, '---Logging remote device logcat---')
jbudorick 2015/08/06 16:31:36 +1
rnephew (Reviews Here) 2015/08/06 16:42:07 Done.
for line in printable_logcat.splitlines():
logging.log(level, line)
+ logging.log(level, '---Ending remote device logcat---')
except KeyError:
logging.error('No logcat found.')
+
+ def _DidDeviceGoOffline(self):
+ device_offline = re.compile('error: device not found')
jbudorick 2015/08/06 16:31:36 This should be compiled into a constant at module
rnephew (Reviews Here) 2015/08/06 16:42:07 Done.
+ zip_file = self._DownloadTestResults(None)
+ with zipfile.ZipFile(zip_file) as z:
+ adb_trace_log = z.read('adb_trace.log')
+ if any(device_offline.search(l) for l in adb_trace_log.splitlines()):
+ logging.critical('---Logging remote device adb trace log---')
jbudorick 2015/08/06 16:31:36 The function name doesn't imply anything about log
rnephew (Reviews Here) 2015/08/06 16:42:07 Done.
+ for line in adb_trace_log.splitlines():
+ logging.critical(line)
+ logging.critical('---Ending remote device adb trace log---')
+ return True
+ return False
« no previous file with comments | « build/android/pylib/remote/device/remote_device_gtest_run.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698