Skip to content

Commit

Permalink
De-flake subpixel-overflow-mouse-drag.html.
Browse files Browse the repository at this point in the history
This test caused failures on Mac bots after unification was enabled
(crrev.com/988868).

The scroll gesture injected by the scrollbar won't necessarily be
processed after a requestAnimationFrame.  Use waitFor instead, and
convert to promise_test.

Bug: 1252915
Change-Id: I1d4aa79f9cba30b02ebab06ec57ef706fbdc1b9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3572201
Reviewed-by: Kevin Ellis <kevers@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#989422}
  • Loading branch information
skobes-chromium authored and Chromium LUCI CQ committed Apr 6, 2022
1 parent 1ad8de2 commit ff2ac04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.

This file was deleted.

@@ -1,5 +1,6 @@
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../resources/gesture-util.js"></script>
<style>
body {
Expand All @@ -17,26 +18,25 @@
height: 200.3px;
}
</style>
Tests scroll behavior when a subpixel scrollbar thumb is dragged by mouse.
<div id="container">
<div id="content"></div>
</div>
<script>
window.jsTestIsAsync = true;
if (window.eventSender) {
onload = function() {
waitForCompositorCommit().then(() => {
promise_test(async t => {
await waitForCompositorCommit();

var container = document.getElementById('container');
eventSender.mouseMoveTo(340, 200);
eventSender.mouseDown();
eventSender.mouseMoveTo(340, 250);
eventSender.mouseUp();

requestAnimationFrame(() => {
shouldBeCloseTo("container.scrollTop", "0.57", 0.02);
finishJSTest();
var expectedScrollTop = 0.57;
var tolerance = 0.02;
await waitFor(() => {
return Math.abs(container.scrollTop - expectedScrollTop) <= tolerance;
});
});
}, "Subpixel scrollbar thumb is dragged by mouse.");
};
}
</script>

0 comments on commit ff2ac04

Please sign in to comment.