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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 | 376 |
377 def _check_for_driver_crash(self, error_line): | 377 def _check_for_driver_crash(self, error_line): |
378 if error_line == "#CRASHED\n": | 378 if error_line == "#CRASHED\n": |
379 # This is used on Windows to report that the process has crashed | 379 # This is used on Windows to report that the process has crashed |
380 # See http://trac.webkit.org/changeset/65537. | 380 # See http://trac.webkit.org/changeset/65537. |
381 self._crashed_process_name = self._server_process.name() | 381 self._crashed_process_name = self._server_process.name() |
382 self._crashed_pid = self._server_process.pid() | 382 self._crashed_pid = self._server_process.pid() |
383 elif (error_line.startswith("#CRASHED - ") | 383 elif (error_line.startswith("#CRASHED - ") |
384 or error_line.startswith("#PROCESS UNRESPONSIVE - ")): | 384 or error_line.startswith("#PROCESS UNRESPONSIVE - ")): |
385 # WebKitTestRunner uses this to report that the WebProcess subproces
s crashed. | 385 # WebKitTestRunner uses this to report that the WebProcess subproces
s crashed. |
386 match = re.match('#(?:CRASHED|PROCESS UNRESPONSIVE) - (\S+)', error_
line) | 386 match = re.match(r'#(?:CRASHED|PROCESS UNRESPONSIVE) - (\S+)', error
_line) |
387 self._crashed_process_name = match.group(1) if match else 'WebProces
s' | 387 self._crashed_process_name = match.group(1) if match else 'WebProces
s' |
388 match = re.search('pid (\d+)', error_line) | 388 match = re.search(r'pid (\d+)', error_line) |
389 pid = int(match.group(1)) if match else None | 389 pid = int(match.group(1)) if match else None |
390 self._crashed_pid = pid | 390 self._crashed_pid = pid |
391 # FIXME: delete this after we're sure this code is working :) | 391 # FIXME: delete this after we're sure this code is working :) |
392 _log.debug('%s crash, pid = %s, error_line = %s', self._crashed_proc
ess_name, str(pid), error_line) | 392 _log.debug('%s crash, pid = %s, error_line = %s', self._crashed_proc
ess_name, str(pid), error_line) |
393 if error_line.startswith("#PROCESS UNRESPONSIVE - "): | 393 if error_line.startswith("#PROCESS UNRESPONSIVE - "): |
394 self._subprocess_was_unresponsive = True | 394 self._subprocess_was_unresponsive = True |
395 self._port.sample_process(self._crashed_process_name, self._cras
hed_pid) | 395 self._port.sample_process(self._crashed_process_name, self._cras
hed_pid) |
396 # We want to show this since it's not a regular crash and probab
ly we don't have a crash log. | 396 # We want to show this since it's not a regular crash and probab
ly we don't have a crash log. |
397 self.error_from_test += error_line | 397 self.error_from_test += error_line |
398 return True | 398 return True |
399 return self.has_crashed() | 399 return self.has_crashed() |
400 | 400 |
401 def _check_for_leak(self, error_line): | 401 def _check_for_leak(self, error_line): |
402 if error_line.startswith("#LEAK - "): | 402 if error_line.startswith("#LEAK - "): |
403 self._leaked = True | 403 self._leaked = True |
404 match = re.match('#LEAK - (\S+) pid (\d+) (.+)\n', error_line) | 404 match = re.match(r'#LEAK - (\S+) pid (\d+) (.+)\n', error_line) |
405 self._leak_log = match.group(3) | 405 self._leak_log = match.group(3) |
406 return self._leaked | 406 return self._leaked |
407 | 407 |
408 def _command_from_driver_input(self, driver_input): | 408 def _command_from_driver_input(self, driver_input): |
409 # FIXME: performance tests pass in full URLs instead of test names. | 409 # FIXME: performance tests pass in full URLs instead of test names. |
410 if driver_input.test_name.startswith( | 410 if driver_input.test_name.startswith( |
411 'http://') or driver_input.test_name.startswith('https://') or d
river_input.test_name == ('about:blank'): | 411 'http://') or driver_input.test_name.startswith('https://') or d
river_input.test_name == ('about:blank'): |
412 command = driver_input.test_name | 412 command = driver_input.test_name |
413 elif self.is_http_test(driver_input.test_name) or self._port.should_use_
wptserve(driver_input.test_name): | 413 elif self.is_http_test(driver_input.test_name) or self._port.should_use_
wptserve(driver_input.test_name): |
414 command = self.test_to_uri(driver_input.test_name) | 414 command = self.test_to_uri(driver_input.test_name) |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 self.decoded_content = None | 541 self.decoded_content = None |
542 self.malloc = None | 542 self.malloc = None |
543 self.js_heap = None | 543 self.js_heap = None |
544 self.stdin_path = None | 544 self.stdin_path = None |
545 | 545 |
546 def decode_content(self): | 546 def decode_content(self): |
547 if self.encoding == 'base64' and self.content is not None: | 547 if self.encoding == 'base64' and self.content is not None: |
548 self.decoded_content = base64.b64decode(self.content) | 548 self.decoded_content = base64.b64decode(self.content) |
549 else: | 549 else: |
550 self.decoded_content = self.content | 550 self.decoded_content = self.content |
OLD | NEW |