commit | a9aa35a2fb904074cddb4e2d889217a899177721 | [log] [tgz] |
---|---|---|
author | Ella Ge <eirage@chromium.org> | Thu Feb 28 18:38:40 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Feb 28 18:38:40 2019 |
tree | 49e646e13970d620c1064e8c8cf6579db3a2ce94 | |
parent | 8366647406f0c84efb80e5b00b003e1ffa765c35 [diff] |
Revert "[Reland] Synthetic input waits on compositor display" This reverts commit b37e23cbd52ba447ab89c6d18f4ea0ecdc3fa5c0. Reason for revert: Suspect this causes failure on WebKit Linux Trusty Leak: https://ci.chromium.org/p/chromium/builders/ci/WebKit%20Linux%20Trusty%20Leak/30727 Original change's description: > [Reland] Synthetic input waits on compositor display > > Reland Note: > { > Previously landed: > https://crrev.com/258ed8d55e4f8b4d99fcde72c3569b9450198092 > Reverted: > https://crrev.com/716496fe0909bc918c410a56f6566390b12adedc > > Revert was due to failing Leak Detector bot. Issue was that the > browser still held a reference to the V8 function for the gesture > completion callback which was never resolved. This CL resolves > callback when the BlinkTestRunner is reset. Original CL uploaded in > PS1. > } > > This CL makes synthetic input - the kind used in web tests and > telemetry (e.g. gpuBenchmarking.scrollBy) - wait until a CompositorFrame > has been submitted by the renderer and displayed by the display > compositor before resolving the completion callback. This means client > code that wants to wait until any observable side-effects of this input > is visible to further input need only wait on the gesture's completion > callback. > > To give a motivating example: suppose we wish to write a test that > scrolls an out-of-process iframe into view and clicks on a button in the > frame. The code might look something like this: > > gpuBenchmarking.smoothScroll(1000, () => { > gpuBenchmarking.tap(0, 0); > }); > > This code contains a race today. The callback for smoothScroll is > invoked as soon as the ScrollEnd is received in the renderer. However, > until a new compositor frame is submitted from the renderer, the tap > may occur against stale hit testing geometry. This is a major source of > flakiness in our tests. > > This CL fixes the problem by forcing the renderer to perform a full > redraw at the end of each gesture. The redraw produces a compositor > frame and we invoke the callback once the compositor frame is displayed. > We do this by reusing the RequestPresentation mechanism in RenderWidget. > RequestPresentation required two modifications to work in web tests > which use a single thread proxy with no scheduler: > > - LayerTreeHost::Composite needs to check the forced redraw flag to > determine whether we need to raster, otherwise it won't produce a > frame > - RequestPresentation must request a main frame since there's no > scheduler to perform the commit, which is what SetNeedsForcedRedraw > requests. > > The timing change exposed an issue in the > overlay-play-button-tap-to-hide.html test so this CL also cleans that > test up to listen to the animation changes in media controls properly. > > Finally, it's possible we may get input in a RenderWidget that's not > currently displayed. e.g. A click event sent via ChromeDriver causes a > TouchStart followed by a TouchEnd. The TouchStart causes a window.open > which opens and focuses a new tab. The TouchEnd then happens on the > background tab. In this case, we should resolve the callback rather than > waiting on a CompositorFrame that'll never come. See ChromeDriver test > testNetworkConnectionTypeIsAppliedToAllTabs for an example of this. > > > TBR=dtapuska@chromium.org,nzolghadr@chromium.org,samans@chromium.org > > Bug: 902446 > Change-Id: Ia2f0a5a6ae51216582bf4cc1d03cb5ba724ddffd > Reviewed-on: https://chromium-review.googlesource.com/c/1490757 > Reviewed-by: David Bokan <bokan@chromium.org> > Reviewed-by: Peter Beverloo <peter@chromium.org> > Commit-Queue: David Bokan <bokan@chromium.org> > Cr-Commit-Position: refs/heads/master@{#636440} TBR=peter@chromium.org,bokan@chromium.org,dtapuska@chromium.org,nzolghadr@chromium.org,samans@chromium.org Change-Id: I9200ea622887575de2d582f1d6e9030dd425aac9 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 902446 Reviewed-on: https://chromium-review.googlesource.com/c/1495442 Reviewed-by: Ella Ge <eirage@chromium.org> Commit-Queue: Ella Ge <eirage@chromium.org> Cr-Commit-Position: refs/heads/master@{#636485}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .