Index: Tools/Scripts/webkitpy/layout_tests/port/driver.py |
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/driver.py b/Tools/Scripts/webkitpy/layout_tests/port/driver.py |
index e7a439d04baa9cbc547e81bcd3f8a5360751853a..b040f4e450eb2c4f67e343a7019efcacb4782b57 100644 |
--- a/Tools/Scripts/webkitpy/layout_tests/port/driver.py |
+++ b/Tools/Scripts/webkitpy/layout_tests/port/driver.py |
@@ -113,6 +113,11 @@ class Driver(object): |
# This could mean they crashed. |
self._subprocess_was_unresponsive = False |
+ # WebKitTestRunenr can report back subprocess DOM-object leaks by printing |
Dirk Pranke
2014/01/28 20:11:46
WebKitTestRunner doesn't exist in Blink :) I'd pro
hajimehoshi
2014/02/14 10:18:59
Done.
|
+ # "#LEAK". This leak detection is enabled only when the flag |
+ # --enable-leak-detection is passed to content_shell. |
+ self._leaked = False |
+ |
# stderr reading is scoped on a per-test (not per-block) basis, so we store the accumulated |
# stderr output, as well as if we've seen #EOF on this driver instance. |
# FIXME: We should probably remove _read_first_block and _read_optional_image_block and |
@@ -180,6 +185,8 @@ class Driver(object): |
# If we were unresponsive append a message informing there may not have been a crash. |
if self._subprocess_was_unresponsive: |
crash_log += 'Process failed to become responsive before timing out.\n' |
+ if self._leaked: |
+ crash_log += 'DOM-object leaking was detected.\n' |
Dirk Pranke
2014/01/30 01:43:21
Given that the process isn't actually crashing, it
hajimehoshi
2014/02/14 10:18:59
Done.
|
# Print stdout and stderr to the placeholder crash log; we want as much context as possible. |
if self.error_from_test: |
@@ -320,6 +327,8 @@ class Driver(object): |
cmd.append('--no-timeout') |
cmd.extend(self._port.get_option('additional_drt_flag', [])) |
cmd.extend(self._port.additional_drt_flag()) |
+ if self._port.get_option('enable_leak_detection'): |
+ cmd.append('--enable-leak-detection') |
cmd.extend(per_test_args) |
cmd.append('-') |
return cmd |
@@ -331,9 +340,10 @@ class Driver(object): |
self._crashed_process_name = self._server_process.name() |
self._crashed_pid = self._server_process.pid() |
elif (error_line.startswith("#CRASHED - ") |
- or error_line.startswith("#PROCESS UNRESPONSIVE - ")): |
+ or error_line.startswith("#PROCESS UNRESPONSIVE - ") |
+ or error_line.startswith("#LEAK - ")): |
Dirk Pranke
2014/01/30 01:43:21
See comments above.
hajimehoshi
2014/02/14 10:18:59
Done.
|
# WebKitTestRunner uses this to report that the WebProcess subprocess crashed. |
- match = re.match('#(?:CRASHED|PROCESS UNRESPONSIVE) - (\S+)', error_line) |
+ match = re.match('#(?:CRASHED|PROCESS UNRESPONSIVE|LEAK) - (\S+)', error_line) |
self._crashed_process_name = match.group(1) if match else 'WebProcess' |
match = re.search('pid (\d+)', error_line) |
pid = int(match.group(1)) if match else None |
@@ -345,6 +355,9 @@ class Driver(object): |
self._port.sample_process(self._crashed_process_name, self._crashed_pid) |
# We want to show this since it's not a regular crash and probably we don't have a crash log. |
self.error_from_test += error_line |
+ elif error_line.startswith("#LEAK - "): |
+ self._leaked = True |
+ self.error_from_test += error_line |
return True |
return self.has_crashed() |