DescriptionExplicitly initialize secondary renderers for layout tests.
Secondary renderers used to be implicitly initized for layout tests in
BlinkTestRunner::Navigate method, relying on comparisons with
LayoutTestRenderProcessObserver::GetInstance()->main_test_runner().
Such initialization is brittle:
1. it relies on correct singling out of a specific BlinkTestRunner and
designating it as a main_test_runner (right now this is the instance
that happens to be created first in the given renderer process)
2. it reinitializes the test after each navigation, which may clobber
previous test state changes which is especially worrisome if another
BlinkTestRunner is present in the same process (with OOPIFs a
BlinkTestRunner for secondary and main test window can coexist in the
same renderer process).
This CL starts to explicitly initialize all secondary renderers via
ShellViewMsg_SetupSecondaryRenderer message, tracking them on the
browser-side in BrowserTestController::HandleNewRenderFrameHost.
This helps avoid the brittleness described above. Additionally
explicit initialization helps to guarantee that a secondary renderer
is initialized before propagating to such renderer changes of
LayoutTestRuntimeFlags (planned in https://crrev.com/1878863002).
Cleaning up BlinkTestRunner::Navigate method (and fixing up the target
BlinkTestRunner used by LayoytTestRenderFrameObserver) enables to remove
one occurence of a global field holding (an essentially non-global)
BlinkTestRunner - we can now remove
LayoutTestRenderProcessObserver::main_test_runner_ field (and then
also remove LayoutTestRenderProcessObserver::SetMainWindow which
can be simply inlined into LayoutTestContentRendererClient).
BUG=595089
Committed: https://crrev.com/8e550a0c01885ed449fd7ea4540f2d6f18762d16
Cr-Commit-Position: refs/heads/master@{#387963}
Patch Set 1 #Patch Set 2 : Self-review. #
Total comments: 3
Patch Set 3 : Rebasing... #Dependent Patchsets: Messages
Total messages: 13 (6 generated)
|