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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py

Issue 1930783002: Fix more android logging crashes in run-webkit-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py
index 9b00de40104c26b86445c1f53fe7d334b0dfcd20..9f5565f58ec047ee24755d9fedb366fea6b4c64a 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/android.py
@@ -257,10 +257,12 @@ class AndroidCommands(object):
error_handler = None
result = self._executive.run_command(self.adb_command() + command,
- error_handler=error_handler, debug_logging=self._debug_logging)
+ error_handler=error_handler,
+ decode_output=False,
+ debug_logging=self._debug_logging)
# We limit the length to avoid outputting too verbose commands, such as "adb logcat".
- self._log_debug('Run adb result: ' + result[:80])
+ self._log_debug('Run adb result: ' + result[:80].decode('ascii', errors='replace'))
return result
def get_serial(self):
@@ -313,12 +315,14 @@ class AndroidCommands(object):
def _determine_adb_version(adb_command_path, executive, debug_logging):
re_version = re.compile('^.*version ([\d\.]+)')
try:
- output = executive.run_command([adb_command_path, 'version'], error_handler=executive.ignore_error,
+ output = executive.run_command([adb_command_path, 'version'],
+ error_handler=executive.ignore_error,
+ decode_output=False,
debug_logging=debug_logging)
except OSError:
return None
- result = re_version.match(output)
+ result = re_version.match(output.decode('ascii', errors='replace'))
if not output or not result:
return None
@@ -355,8 +359,10 @@ class AndroidDevices(object):
re_device = re.compile('^([a-zA-Z0-9_:.-]+)\tdevice$', re.MULTILINE)
result = executive.run_command([AndroidCommands.adb_command_path(executive, debug_logging=self._debug_logging), 'devices'],
- error_handler=executive.ignore_error, debug_logging=self._debug_logging)
- devices = re_device.findall(result)
+ error_handler=executive.ignore_error,
+ decode_output=False,
+ debug_logging=self._debug_logging)
+ devices = re_device.findall(result.decode('ascii', errors='replace'))
if not devices:
return []
@@ -508,14 +514,16 @@ class AndroidPort(base.Port):
pids = self._executive.running_pids(lambda name: 'adb' in name)
if not pids:
# Apparently adb is not running, which is unusual. Running any adb command should start it.
- self._executive.run_command(['adb', 'devices'])
+ self._executive.run_command(['adb', 'devices'],
+ decode_output=False)
pids = self._executive.running_pids(lambda name: 'adb' in name)
if not pids:
_log.error("The adb daemon does not appear to be running.")
return False
for pid in pids:
- self._executive.run_command(['taskset', '-p', '-c', '0', str(pid)])
+ self._executive.run_command(['taskset', '-p', '-c', '0', str(pid)],
+ decode_output=False)
if not result:
_log.error('For complete Android build requirements, please see:')
@@ -734,7 +742,8 @@ http://goto.google.com/cr-android-perf-howto
def _perf_version_string(self, perf_path):
try:
- return self._host.executive.run_command([perf_path, '--version'])
+ return self._host.executive.run_command([perf_path, '--version'],
+ decode_output=False)
except:
return None
@@ -775,9 +784,10 @@ http://goto.google.com/cr-android-perf-howto
]
if perfhost_path:
perfhost_args = [perfhost_path] + perfhost_report_command + ['--call-graph', 'none']
- perf_output = self._host.executive.run_command(perfhost_args)
+ perf_output = self._host.executive.run_command(perfhost_args,
+ decode_output=False)
# We could save off the full -g report to a file if users found that useful.
- _log.debug(self._first_ten_lines_of_profile(perf_output))
+ _log.debug(self._first_ten_lines_of_profile(perf_output).decode('ascii', errors='replace'))
else:
_log.debug("""
Failed to find perfhost_linux binary, can't process samples from the device.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698