[TaskScheduler] Handle early first paint in NoBackgroundTasksTest.
NoBackgroundTasksTest.FirstNonEmptyPaintWithoutBackgroundTasks is a test that verifies that the first paint in a tab can happen when TaskPriority::BEST_EFFORT tasks don't run. Before this CL, the test's body ran a RunLoop until WebContentsObserver::DidFirstVisuallyNonEmptyPaint() was invoked. A timeout occured if the first paint occured before the test's body was entered. Having the first paint before the test's body is possible, because InProcessBrowserTest::PreRunTestOnMainThread() runs tasks before jumping to the test's body (see https://cs.chromium.org/chromium/src/chrome/test/base/in_process_browser_test.cc?l=486&rcl=8edfdb37ebe40b1ba4dae27a23d8edaeac09a0ee). This CL fixes the issue by skipping running the RunLoop if WebContents::CompletedFirstVisuallyNonEmptyPaint() is already true at the beginning of the test's body. This is one of multiple fixes that will allow us to enable the test on ChromeOS. Bug: 833989 Change-Id: I0ce024bda351059c4e0ba8648e1f0f0459eb19ac Reviewed-on: https://chromium-review.googlesource.com/1187131Reviewed-by:Avi Drissman <avi@chromium.org> Commit-Queue: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#585884}
Showing
Please register or sign in to comment