[FractionalScroll] Make Blink unittests pass
This CL fixes Blink unit tests when the FractionalScrollOffsets flag is turned on. This flag enables storing floating point scroll offsets inside Blink's ScrollableArea objects. This means that fractional offsets are now visible to JS and test code; some tests need to be adjusted to the new expectations. The typical test here performed something like a ScrollIntoView which should land on a fractional offset when trying to center an element. Prior to FractionalScrollOffsets, this would be floored. I've adjusted these tests to either change the page slightly so that we naturally land on an integral offset or provided a new expectation behind the runtime enabled feature. This is ok since these tests are just checking that an element is scrolled into view, we don't care about exact pixel offsets. For the smooth scrolling tests, I allowed a 1px difference in the expectation since these are checking a scroll offset mid-animation. After this CL, all Blink unit tests pass with FractionalScrollOffsets enabled. Bug: 414283 Change-Id: Ief639a780d0780ab74ca11718c05921ed8a4670d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1690221 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by:Stefan Zager <szager@chromium.org> Cr-Commit-Position: refs/heads/master@{#676135}
Showing
Please register or sign in to comment