Commit 4e5f6741 authored by David Bokan's avatar David Bokan Committed by Commit Bot

De-flake track-scroll.html

This test was originally added to fix https://crbug.com/578554 which was
that the autoscroll animation when holding down the mouse button over
the scrollbar track would overshoot the cursor. The test added there was
testing this in a round about way: it would click twice in the same
location on the track, assuming that the animation would start but not
finish before the second click. In this way, it was checking that the
calculation logic was using the final position of the thumb.

However, this makes an assumption about frame timing and animations. It
likely became flaky in the threaded suite with the introduction of the
compositor scrollbar controller, which would try to update the animation
in this case.

This CL replaces the test with a more direct check for the original bug
by holding the mouse button down over the track and waiting for the
scrollTop value to settle.

Note, the test fails consistently on Mac with compositing enabled. This
is due to the Mac-specific expectation for page scrolling. This specific
value is implemented only on the main thread so when compositor threaded
scrollbars are used, we get the same value as on other platforms. See
https://crbug.com/1133538

Bug: 915926,901906,854910
Change-Id: I4e5774a0ee8452ac31b6d199b5d2c68d67feca7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438677Reviewed-by: default avatarLan Wei <lanwei@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812368}
parent e01f1bfe
......@@ -1851,8 +1851,6 @@ crbug.com/574283 virtual/threaded-prefer-compositing/fast/scroll-behavior/smooth
crbug.com/574283 virtual/threaded-prefer-compositing/fast/scroll-behavior/smooth-scroll/mousewheel-scroll-interrupted.html [ Skip ]
crbug.com/665577 virtual/threaded-prefer-compositing/fast/scroll-behavior/overflow-scroll-root-frame-animates.html [ Pass Timeout ]
# This test was [Pass Failure] on Mac and linked crbug.com/665577, lately it's also flakey on all 3 platforms:
crbug.com/901906 virtual/threaded-prefer-compositing/fast/scroll-behavior/smooth-scroll/track-scroll.html [ Pass Failure ]
crbug.com/599670 [ Win ] http/tests/devtools/resource-parameters-ipv6.js [ Pass Failure Crash ]
crbug.com/472330 fast/borders/border-image-outset-split-inline-vertical-lr.html [ Failure ]
......@@ -5275,8 +5273,9 @@ crbug.com/849978 http/tests/devtools/elements/styles-4/stylesheet-source-url-com
crbug.com/854538 [ Win7 ] http/tests/security/contentSecurityPolicy/1.1/form-action-src-default-ignored-with-redirect.html [ Skip ]
# Sheriff 2018-06-21
crbug.com/854910 [ Mac ] fast/scroll-behavior/smooth-scroll/track-scroll.html [ Failure Pass ]
# The compositor scrollbar controller lacks a Mac-specific behavior so this
# test fails when run with compositing enabled.
crbug.com/1133538 [ Mac ] virtual/threaded-prefer-compositing/fast/scroll-behavior/smooth-scroll/track-scroll.html [ Failure ]
# Sheriff 2018-06-25
crbug.com/855816 [ Win ] virtual/stable/http/tests/navigation/rename-subframe-goback.html [ Pass Timeout ]
......
......@@ -7,26 +7,21 @@ body {
height: 1800px;
}
</style>
<body>
<script>
// Compute ScrollableArea::pageStep.
var pageStep = innerHeight * 0.875;
if (navigator.userAgent.indexOf("Mac OS X") >= 0)
pageStep = Math.max(pageStep, innerHeight - 40);
// Compute ScrollableArea::pageStep.
var pageStep = innerHeight * 0.875;
if (navigator.userAgent.indexOf("Mac OS X") >= 0)
pageStep = Math.max(pageStep, innerHeight - 40);
promise_test(async () => {
// Click in the vertical scrollbar track, below the thumb, and hold the
// mouse button down. The animation shouldn't continue past the initial
// page step since the initial page step will take the scrollbar thumb
// under the cursor.
await mouseMoveTo(790, 280);
await mouseDownAt(790, 280);
// Turn on smooth scrolling.
internals.settings.setScrollAnimatorEnabled(true);
promise_test(async () => {
// Click in the vertical scrollbar track, below the thumb.
await mouseClickOn(790, 280);
// A second click should have no effect since we will be under the thumb
// by the time the animation completes.
await mouseClickOn(790, 280);
await waitFor( () => {return scrollY == pageStep;});
}, 'This test scrolls by clicking in the scrollbar track.');
await waitForAnimationEndTimeBased( () => { return scrollY; } );
assert_equals(window.scrollY, pageStep);
}, 'Scrollbar track autoscrolling doesn\'t overshoot cursor.');
</script>
</body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment