Avoid storing a pointer to the "MainFrame" in the WorkQueue.
The main frame can change over the life of the TestRunner, if we swap the frame on navigation. Instead, bind the current frame, via the TestRunnerBindings. This means the FindInProcessMainWindowMainFrame() is only used for a) TestRunner::SetMockScreenOrientation() which is a bug to be fixed b) TestRunner::FinishTest() (and callers to it). That means we no longer rely on the main frame being stable or consistent in order to be correct. FinishTest() will do the right thing and find the main frame's process. The last issue is that the "main window" is only set on the RenderView (well, the RenderView's BlinkTestRunner) at the start of the test, so if swapping the main frame also changes to a different RenderView then it will not know it's the main window. Either the browser needs to keep the "main window" bit up to date or we can move the BlinkTestRunner::TestFinished() code up to the browser process, where it can invoke the right things in the right renderer. The tricky bit is.. the synchronous layout at the end of the test done in the renderer. But this only matters if the frame is already in the main frame's process. R=avi@chromium.org Bug: 1069111 Change-Id: Iae77bbabeeb074ba1595e7652f07f31cb556a1e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2298053 Auto-Submit: danakj <danakj@chromium.org> Commit-Queue: Nasko Oskov <nasko@chromium.org> Reviewed-by:Nasko Oskov <nasko@chromium.org> Cr-Commit-Position: refs/heads/master@{#788379}
Showing
Please register or sign in to comment