-
danakj authored
Always close all the windows, but do it after leak checks. This removes one main-frame-renderer-controlled step during test end, moving control to the browser process in order to deal with site isolation and render document better. The test runner defaults to not closing windows on the first test run, but then switches to closing windows on future tests. This would make for flaky behaviour. Most tests, when allowing windows to open call this with `true` in order to close their windows at the end of the test. Some call it with no arguments, which does nothing at all. When passed `true` windows were closed by the renderer during Reset() which is run in the ResetRendererAfterWebTest step in the browser. That step is followed by a leak checker (if requested on the cmd line) then we move on to the next test. There should be no legitimate reason to pollute the next test with an open window, so we would like windows to always be closed. However there is one test that closes a window itself and wants to look for leaks if the close failed: LayoutTests/plugins/open-and-close-window-with-plugin.html It was added along with the ability to leak windows in this CL https://github.com/WebKit/webkit/commit/a9fd077f3ec2719eaf12908907fe4bff964af75a It claims: > This tests that opening a window with a WebView that contains a > plugin, and then closing the window without calling -[WebView close] > does not leak the window or the web view. So we replace the renderer-controlled logic with a checkForLeakedWindows(). In the browser, we close all windows opened by the test before checking for leaks, unless checkForLeakedWindows() was called. In that case, we would close the windows after checking for leaks. R=avi@chromium.org Bug: 866140, 1069111 Change-Id: I9eb64e997445593bf28b03429cb4d0f34bfe6ab9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2252943 Commit-Queue: danakj <danakj@chromium.org> Reviewed-by:
Daniel Cheng <dcheng@chromium.org> Reviewed-by:
Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/master@{#781690}
5169e162