Skip to content

Commit

Permalink
Fix snap-scrolls-visual-viewport
Browse files Browse the repository at this point in the history
Add a wait for a scroll event to handle a delay between queuing and
handling of the gesture.

Bug: 878878
Change-Id: I6d887cec2d9206f8a73c8a5cf4eb5a7a8d4baae1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2727600
Reviewed-by: Xida Chen <xidachen@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#859117}
  • Loading branch information
Kevin Ellis authored and Chromium LUCI CQ committed Mar 2, 2021
1 parent 260f64c commit 8f50251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions third_party/blink/web_tests/TestExpectations
Expand Up @@ -4856,10 +4856,7 @@ crbug.com/1030258 http/tests/devtools/network/network-cookies-pane.js [ Pass Fai
crbug.com/1041830 http/tests/devtools/tracing/timeline-js/timeline-js-line-level-profile.js [ Pass Failure ]

# Enable scroll-snap tests on impl thread
# These are currently failing on Mac which needs more investigation, snap-scrolls-visual-viewport seems flaky

crbug.com/878878 virtual/threaded/fast/scroll-snap/animate-fling-to-snap-points.html [ Failure Pass Timeout ]
crbug.com/878878 virtual/threaded/fast/scroll-snap/snap-scrolls-visual-viewport.html [ Failure Pass ]

# Sheriff 2019-12-13
crbug.com/1032451 [ Win7 ] virtual/webrtc-wpt-plan-b/external/wpt/webrtc/idlharness.https.window.html [ Failure Pass ]
Expand Down
Expand Up @@ -55,16 +55,17 @@

const x = 200;
const y = 200;
const scrollPromise = waitForScrollEvent(document);
await smoothScroll(scale_factor * scroll_delta,
x,
y,
SOURCE_TYPE,
scroll_direction,
SPEED_INSTANT);

await scrollPromise;
await waitForAnimationEndTimeBased(() => {
return window.scrollY + window.visualViewport.offsetTop;
});
return window.scrollY + window.visualViewport.offsetTop;
});

assert_approx_equals(window.scrollY, layout_viewport_y, 1);
assert_approx_equals(window.visualViewport.offsetTop, visual_viewport_y, 1);
Expand Down

0 comments on commit 8f50251

Please sign in to comment.