| OLD | NEW |
| 1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return self._port._get_crash_log(self._crashed_process_name, self._crash
ed_pid, stdout, stderr, newer_than) | 214 return self._port._get_crash_log(self._crashed_process_name, self._crash
ed_pid, stdout, stderr, newer_than) |
| 215 | 215 |
| 216 # FIXME: Seems this could just be inlined into callers. | 216 # FIXME: Seems this could just be inlined into callers. |
| 217 @classmethod | 217 @classmethod |
| 218 def _command_wrapper(cls, wrapper_option): | 218 def _command_wrapper(cls, wrapper_option): |
| 219 # Hook for injecting valgrind or other runtime instrumentation, | 219 # Hook for injecting valgrind or other runtime instrumentation, |
| 220 # used by e.g. tools/valgrind/valgrind_tests.py. | 220 # used by e.g. tools/valgrind/valgrind_tests.py. |
| 221 return shlex.split(wrapper_option) if wrapper_option else [] | 221 return shlex.split(wrapper_option) if wrapper_option else [] |
| 222 | 222 |
| 223 def is_http_test(self, test_name): | 223 def is_http_test(self, test_name): |
| 224 return True | 224 return False |
| 225 | 225 |
| 226 def test_to_uri(self, test_name): | 226 def test_to_uri(self, test_name): |
| 227 """Convert a test name to a URI. | 227 """Convert a test name to a URI. |
| 228 | 228 |
| 229 Tests which have an 'https' directory in their paths (e.g. | 229 Tests which have an 'https' directory in their paths (e.g. |
| 230 '/http/tests/security/mixedContent/https/test1.html') will be loaded | 230 '/http/tests/security/mixedContent/https/test1.html') will be loaded |
| 231 over HTTPS; all other tests over HTTP. | 231 over HTTPS; all other tests over HTTP. |
| 232 """ | 232 """ |
| 233 assert self.is_http_test(test_name) | 233 assert self.is_http_test(test_name) |
| 234 return "http://127.0.0.1:8000/sky/tests/" + test_name | 234 return "http://127.0.0.1:8000/sky/tests/" + test_name |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 if self._profiler: | 323 if self._profiler: |
| 324 self._profiler.profile_after_exit() | 324 self._profiler.profile_after_exit() |
| 325 | 325 |
| 326 if self._driver_tempdir: | 326 if self._driver_tempdir: |
| 327 self._port._filesystem.rmtree(str(self._driver_tempdir)) | 327 self._port._filesystem.rmtree(str(self._driver_tempdir)) |
| 328 self._driver_tempdir = None | 328 self._driver_tempdir = None |
| 329 | 329 |
| 330 self._current_cmd_line = None | 330 self._current_cmd_line = None |
| 331 | 331 |
| 332 def cmd_line(self, pixel_tests, per_test_args): | 332 def cmd_line(self, pixel_tests, per_test_args): |
| 333 cmd = self._command_wrapper(self._port.get_option('wrapper')) | 333 return [ |
| 334 cmd.append(self._port._path_to_driver()) | 334 self._port._path_to_driver(), |
| 335 if self._no_timeout: | 335 '--non-interactive', |
| 336 cmd.append('--no-timeout') | 336 # base's CommandLine parser is dumb, this = is required. |
| 337 cmd.extend(self._port.get_option('additional_drt_flag', [])) | 337 '--package-root=%s' % self._port._dart_packages_root() |
| 338 cmd.extend(self._port.additional_drt_flag()) | 338 ] |
| 339 if self._port.get_option('enable_leak_detection'): | |
| 340 cmd.append('--enable-leak-detection') | |
| 341 cmd.extend(per_test_args) | |
| 342 return cmd | |
| 343 | 339 |
| 344 def _check_for_driver_crash(self, error_line): | 340 def _check_for_driver_crash(self, error_line): |
| 345 if error_line == "#CRASHED\n": | 341 if error_line == "#CRASHED\n": |
| 346 # This is used on Windows to report that the process has crashed | 342 # This is used on Windows to report that the process has crashed |
| 347 # See http://trac.webkit.org/changeset/65537. | 343 # See http://trac.webkit.org/changeset/65537. |
| 348 self._crashed_process_name = self._server_process.name() | 344 self._crashed_process_name = self._server_process.name() |
| 349 self._crashed_pid = self._server_process.pid() | 345 self._crashed_pid = self._server_process.pid() |
| 350 elif (error_line.startswith("#CRASHED - ") | 346 elif (error_line.startswith("#CRASHED - ") |
| 351 or error_line.startswith("#PROCESS UNRESPONSIVE - ")): | 347 or error_line.startswith("#PROCESS UNRESPONSIVE - ")): |
| 352 # WebKitTestRunner uses this to report that the WebProcess subproces
s crashed. | 348 # WebKitTestRunner uses this to report that the WebProcess subproces
s crashed. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 self.decoded_content = None | 523 self.decoded_content = None |
| 528 self.malloc = None | 524 self.malloc = None |
| 529 self.js_heap = None | 525 self.js_heap = None |
| 530 self.stdin_path = None | 526 self.stdin_path = None |
| 531 | 527 |
| 532 def decode_content(self): | 528 def decode_content(self): |
| 533 if self.encoding == 'base64' and self.content is not None: | 529 if self.encoding == 'base64' and self.content is not None: |
| 534 self.decoded_content = base64.b64decode(self.content) | 530 self.decoded_content = base64.b64decode(self.content) |
| 535 else: | 531 else: |
| 536 self.decoded_content = self.content | 532 self.decoded_content = self.content |
| OLD | NEW |