[wptrunner] Implement --leak-check
for Blink-based browsers (#47850)
... to support Chromium CI testing needs.
- Introduce
LeakProtocolPart
, an optional API that lets wptrunner
check for leaks programmatically. The default implementation checks
that navigating toabout:blank
after a test cleans up the DOM
objects it created. - For browsers that implement
LeakProtocolPart
, the base WebDriver
executors run the leak check after each test and report the results as
an extra test result field namedleak_counters
. - Currently, the only implementers of
LeakProtocolPart
are
ChromeDriver-based browsers, which use a nonstandard Chrome DevTools
Protocol method 0 to count DOM objects. For those browsers, a leak
is coerced to CRASH to report the result appropriately and induce a
browser restart.
See Also: https://crbug.com/40887057