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

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/port/android.py

Issue 1169433005: Try Yet Again to handle the output we get from android in run-webkit-tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: patch for review Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/layout_tests/port/base.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2012 Google Inc. All rights reserved. 1 # Copyright (C) 2012 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 def _shut_down_http_server(self, pid): 652 def _shut_down_http_server(self, pid):
653 return self._host_port._shut_down_http_server(pid) 653 return self._host_port._shut_down_http_server(pid)
654 654
655 def _driver_class(self): 655 def _driver_class(self):
656 return ChromiumAndroidDriver 656 return ChromiumAndroidDriver
657 657
658 # Local private methods. 658 # Local private methods.
659 659
660 @staticmethod 660 @staticmethod
661 def _android_server_process_constructor(port, server_name, cmd_line, env=Non e, logging=False): 661 def _android_server_process_constructor(port, server_name, cmd_line, env=Non e, logging=False):
662 # We need universal_newlines=True, because 'adb shell' for some unknown reason
663 # does newline conversion of unix-style LF into win-style CRLF (and we n eed
664 # to convert that back). This can cause headaches elsewhere because
665 # server_process' stdout and stderr are now unicode file-like objects,
666 # not binary file-like objects like all of the other ports are.
667 # FIXME: crbug.com/496983.
662 return server_process.ServerProcess(port, server_name, cmd_line, env, 668 return server_process.ServerProcess(port, server_name, cmd_line, env,
663 universal_newlines=True, treat_no_da ta_as_crash=True, logging=logging) 669 universal_newlines=True, treat_no_da ta_as_crash=True, logging=logging)
664 670
665 671
666 class AndroidPerf(SingleFileOutputProfiler): 672 class AndroidPerf(SingleFileOutputProfiler):
667 _cached_perf_host_path = None 673 _cached_perf_host_path = None
668 _have_searched_for_perf_host = False 674 _have_searched_for_perf_host = False
669 675
670 def __init__(self, host, executable_path, output_dir, android_commands, symf s_path, kallsyms_path, identifier=None): 676 def __init__(self, host, executable_path, output_dir, android_commands, symf s_path, kallsyms_path, identifier=None):
671 super(AndroidPerf, self).__init__(host, executable_path, output_dir, "da ta", identifier) 677 super(AndroidPerf, self).__init__(host, executable_path, output_dir, "da ta", identifier)
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 stdout += '********* [%s] Logcat:\n%s' % (self._android_commands.get_ser ial(), self._get_logcat()) 1039 stdout += '********* [%s] Logcat:\n%s' % (self._android_commands.get_ser ial(), self._get_logcat())
1034 if not stderr: 1040 if not stderr:
1035 stderr = '' 1041 stderr = ''
1036 stderr += '********* [%s] Tombstone file:\n%s' % (self._android_commands .get_serial(), self._get_last_stacktrace()) 1042 stderr += '********* [%s] Tombstone file:\n%s' % (self._android_commands .get_serial(), self._get_last_stacktrace())
1037 1043
1038 if not self._port.get_option('disable_breakpad'): 1044 if not self._port.get_option('disable_breakpad'):
1039 crashes = self._pull_crash_dumps_from_device() 1045 crashes = self._pull_crash_dumps_from_device()
1040 for crash in crashes: 1046 for crash in crashes:
1041 stderr += '********* [%s] breakpad minidump %s:\n%s' % (self._po rt.host.filesystem.basename(crash), self._android_commands.get_serial(), self._p ort._dump_reader._get_stack_from_dump(crash)) 1047 stderr += '********* [%s] breakpad minidump %s:\n%s' % (self._po rt.host.filesystem.basename(crash), self._android_commands.get_serial(), self._p ort._dump_reader._get_stack_from_dump(crash))
1042 1048
1043 return super(ChromiumAndroidDriver, self)._get_crash_log(stdout, stderr, newer_than) 1049 # The parent method expects stdout and stderr to be byte streams, but
1050 # since adb shell does newline conversion, we used universal_newlines
1051 # when launching the processes, and hence our stdout and stderr are
1052 # text objects that need to be encoded back into bytes.
1053 return super(ChromiumAndroidDriver, self)._get_crash_log(
1054 stdout.encode('utf8', 'replace'),
1055 stderr.encode('utf8', 'replace'),
1056 newer_than)
1044 1057
1045 def cmd_line(self, pixel_tests, per_test_args): 1058 def cmd_line(self, pixel_tests, per_test_args):
1046 # The returned command line is used to start _server_process. In our cas e, it's an interactive 'adb shell'. 1059 # The returned command line is used to start _server_process. In our cas e, it's an interactive 'adb shell'.
1047 # The command line passed to the driver process is returned by _driver_c md_line() instead. 1060 # The command line passed to the driver process is returned by _driver_c md_line() instead.
1048 return self._android_commands.adb_command() + ['shell'] 1061 return self._android_commands.adb_command() + ['shell']
1049 1062
1050 def _android_driver_cmd_line(self, pixel_tests, per_test_args): 1063 def _android_driver_cmd_line(self, pixel_tests, per_test_args):
1051 return driver.Driver.cmd_line(self, pixel_tests, per_test_args) 1064 return driver.Driver.cmd_line(self, pixel_tests, per_test_args)
1052 1065
1053 @staticmethod 1066 @staticmethod
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 return command 1281 return command
1269 1282
1270 def _read_prompt(self, deadline): 1283 def _read_prompt(self, deadline):
1271 last_char = '' 1284 last_char = ''
1272 while True: 1285 while True:
1273 current_char = self._server_process.read_stdout(deadline, 1) 1286 current_char = self._server_process.read_stdout(deadline, 1)
1274 if current_char == ' ': 1287 if current_char == ' ':
1275 if last_char in ('#', '$'): 1288 if last_char in ('#', '$'):
1276 return 1289 return
1277 last_char = current_char 1290 last_char = current_char
OLDNEW
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/layout_tests/port/base.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698