Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ScrollUnification] Fix LayerTreeHostTest
This CL updates expectations for tests in layer_tree_host_unittest_scroll to pass when the scroll unification flag is turned on. We also run each LayerTreeHostTest with both states of the flag. Due to the use of macros, using a parameterized test is difficult so we do this manually inside the macro definition. These changes are mostly straightforward updates to expectations returned from ScrollBegin. Additionally, we replace instances of TryScroll with ScrollBegin as the former will go away after unification and we shouldn't be directly calling this internal method anyway. Its only external callers were these tests so this method is also made private. LayerTreeHostScrollTestScrollZeroMaxScrollOffset gets some significant changes to the test structure. This multi-step test was posting a SetNeedsCommit to the main thread which causes a main frame; the test step was implicitly tracked in the frame number. By updating to use ScrollBegin/ScrollEnd, the test became racy (under TSan) because ScrollEnd calls SetNeedsCommit as well and can in some cases synchronously post a task to the main thread. This meant that in some cases we might post two MBF which can commit before the first is drawn. The issue is solved by manually tracking the step and requesting the commit from the main frame. NonScrollingNonFastScrollableRegion also required a fix; it mixed up the container and scrollable bounds on the scrolling node so that the node wasn't actually scrollable. The test passed without unification because we fallback to the viewport node when we can't scroll any other node; the test wasn't checking which node is scrolling, only that one was. The fallback doesn't work in unification because we (correctly) expect that all scrolls will chain up through the viewport node. In this case, the test also didn't correctly parent the scroll node so this is fixed as well by making the layers parent from the outer viewport scroll layer. Bug: 1086625 Change-Id: I3c0c6b5f9e976c038f537fe50e1861b12d51acf5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2223088 Reviewed-by: Xida Chen <xidachen@chromium.org> Commit-Queue: David Bokan <bokan@chromium.org> Cr-Commit-Position: refs/heads/master@{#774604}
- Loading branch information