Truly independent web browser
LibWeb: Use supported wheel phases in async scrolling tests
Andreas Kling27ef5c6ccce2
diff --git a/Tests/LibWeb/Text/input/async-scrolling/arrow-key-leaves-momentum-of-another-box.html b/Tests/LibWeb/Text/input/async-scrolling/arrow-key-leaves-momentum-of-another-box.htmlindex ae087d88e2d..7b0003dec46 100644--- a/Tests/LibWeb/Text/input/async-scrolling/arrow-key-leaves-momentum-of-another-box.html+++ b/Tests/LibWeb/Text/input/async-scrolling/arrow-key-leaves-momentum-of-another-box.html@@ -43,7 +43,7 @@const flungStart = flung.scrollTop;const keyedStart = keyed.scrollTop;const ended = Promise.all([nextScrollendOf(flung), nextScrollendOf(keyed)]);- internals.wheelThroughUIProcess(150, 150, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(150, 150, 0, 0, true, "ongoing");for (let step = 0; step < 3; step++)await internals.wheelThroughUIProcess(150, 150, 0, 50, true, "ongoing");for (let step = 0; step < 3; step++) {diff --git a/Tests/LibWeb/Text/input/async-scrolling/arrow-key-takes-over-from-momentum.html b/Tests/LibWeb/Text/input/async-scrolling/arrow-key-takes-over-from-momentum.htmlindex c33c2332360..c797898ff7f 100644--- a/Tests/LibWeb/Text/input/async-scrolling/arrow-key-takes-over-from-momentum.html+++ b/Tests/LibWeb/Text/input/async-scrolling/arrow-key-takes-over-from-momentum.html@@ -16,7 +16,7 @@const nextScrollend = () => new Promise(resolve => document.addEventListener("scrollend", resolve, { once: true }));const flingThenPressDown = async ({ whileMomentumStepIsPending = false } = {}) => {- internals.wheelThroughUIProcess(400, 300, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(400, 300, 0, 0, true, "ongoing");for (let step = 0; step < 3; step++)await internals.wheelThroughUIProcess(400, 300, 0, 50, true, "ongoing");for (let step = 0; step < 3; step++) {@@ -68,7 +68,7 @@const offsetBeforeNewGesture = window.scrollY;println(`After the key, before a new gesture: moved ${offsetBeforeNewGesture - offsetBeforeKey}`);ended = nextScrollend();- internals.wheelThroughUIProcess(400, 300, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(400, 300, 0, 0, true, "ongoing");for (let step = 0; step < 2; step++)await internals.wheelThroughUIProcess(400, 300, 0, 50, true, "ongoing");await internals.wheelThroughUIProcess(400, 300, 0, 0, true, "ended");diff --git a/Tests/LibWeb/Text/input/async-scrolling/fling-ends-once.html b/Tests/LibWeb/Text/input/async-scrolling/fling-ends-once.htmlindex ad9e680b3cb..7ce5fb2bf46 100644--- a/Tests/LibWeb/Text/input/async-scrolling/fling-ends-once.html+++ b/Tests/LibWeb/Text/input/async-scrolling/fling-ends-once.html@@ -41,7 +41,7 @@const fling = async (scroller, y) => {let scrollends = 0;scroller.addEventListener("scrollend", () => scrollends++);- internals.wheelThroughUIProcess(50, y, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, y, 0, 0, true, "ongoing");for (let step = 0; step < 3; step++)await internals.wheelThroughUIProcess(50, y, 0, 50, true, "ongoing");for (let step = 0; step < 5; step++) {diff --git a/Tests/LibWeb/Text/input/async-scrolling/fling-ends-with-its-momentum-under-a-wheel-listener.html b/Tests/LibWeb/Text/input/async-scrolling/fling-ends-with-its-momentum-under-a-wheel-listener.htmlindex efa7cafcd9c..7de11e26616 100644--- a/Tests/LibWeb/Text/input/async-scrolling/fling-ends-with-its-momentum-under-a-wheel-listener.html+++ b/Tests/LibWeb/Text/input/async-scrolling/fling-ends-with-its-momentum-under-a-wheel-listener.html@@ -29,7 +29,7 @@await animationFrame();await animationFrame();- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");for (let step = 0; step < 3; step++)await internals.wheelThroughUIProcess(50, 50, 0, 50, true, "ongoing");for (let step = 0; step < 5; step++) {diff --git a/Tests/LibWeb/Text/input/async-scrolling/instant-script-scroll-during-a-pan.html b/Tests/LibWeb/Text/input/async-scrolling/instant-script-scroll-during-a-pan.htmlindex e26e5dac29f..54ea619760d 100644--- a/Tests/LibWeb/Text/input/async-scrolling/instant-script-scroll-during-a-pan.html+++ b/Tests/LibWeb/Text/input/async-scrolling/instant-script-scroll-during-a-pan.html@@ -18,7 +18,7 @@// The compositor pans the page by 100 while the main thread is busy, so the main thread has not heard of the// pan when the page scrolls itself to 50. The page goes to 50 rather than 50 past where the pan took it.- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");await animationFrame();await animationFrame();internals.wheelThroughUIProcess(50, 50, 0, 100, true, "ongoing");diff --git a/Tests/LibWeb/Text/input/async-scrolling/key-step-after-an-unadopted-pan.html b/Tests/LibWeb/Text/input/async-scrolling/key-step-after-an-unadopted-pan.htmlindex 25c064b0a89..101e8cfc59c 100644--- a/Tests/LibWeb/Text/input/async-scrolling/key-step-after-an-unadopted-pan.html+++ b/Tests/LibWeb/Text/input/async-scrolling/key-step-after-an-unadopted-pan.html@@ -18,7 +18,7 @@// The compositor pans the page by 100 while the main thread is busy, so the main thread has not heard of the// pan when an arrow key steps the page by another 100. The step goes on from where the pan took the page.- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");await animationFrame();await animationFrame();internals.wheelThroughUIProcess(50, 50, 0, 100, true, "ongoing");diff --git a/Tests/LibWeb/Text/input/async-scrolling/relative-script-scroll-during-a-pan.html b/Tests/LibWeb/Text/input/async-scrolling/relative-script-scroll-during-a-pan.htmlindex cf4125fc27c..f42a7465f63 100644--- a/Tests/LibWeb/Text/input/async-scrolling/relative-script-scroll-during-a-pan.html+++ b/Tests/LibWeb/Text/input/async-scrolling/relative-script-scroll-during-a-pan.html@@ -18,7 +18,7 @@// The compositor pans the page by 100 while the main thread is busy, so the main thread has not heard of the// pan when the page scrolls itself by 50. The page goes 50 past where the pan took it, which is where it is.- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");internals.wheelThroughUIProcess(50, 50, 0, 100, true, "ongoing");busyWait(200);window.scrollBy(0, 50);diff --git a/Tests/LibWeb/Text/input/async-scrolling/script-scroll-stops-a-fling.html b/Tests/LibWeb/Text/input/async-scrolling/script-scroll-stops-a-fling.htmlindex c616315d1c2..760f8b3d05e 100644--- a/Tests/LibWeb/Text/input/async-scrolling/script-scroll-stops-a-fling.html+++ b/Tests/LibWeb/Text/input/async-scrolling/script-scroll-stops-a-fling.html@@ -11,7 +11,7 @@await animationFrame();await animationFrame();- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");await internals.wheelThroughUIProcess(50, 50, 0, 50, true, "ongoing");await internals.wheelThroughUIProcess(50, 50, 0, 40, true, "momentum");await animationFrame();@@ -29,7 +29,7 @@println(`scrollY after the fling: ${window.scrollY}`);// The next gesture scrolls as usual.- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");await internals.wheelThroughUIProcess(50, 50, 0, 50, true, "ongoing");await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ended");for (let frame = 0; frame < 4; frame++)diff --git a/Tests/LibWeb/Text/input/async-scrolling/script-smooth-scroll-during-a-wheel-gesture-ends-once.html b/Tests/LibWeb/Text/input/async-scrolling/script-smooth-scroll-during-a-wheel-gesture-ends-once.htmlindex 48974a21521..93baa4d12dc 100644--- a/Tests/LibWeb/Text/input/async-scrolling/script-smooth-scroll-during-a-wheel-gesture-ends-once.html+++ b/Tests/LibWeb/Text/input/async-scrolling/script-smooth-scroll-during-a-wheel-gesture-ends-once.html@@ -27,7 +27,7 @@// A script starts a smooth scroll while the fingers are still down, then they lift. The box's scroll ends once,// when the script's scroll arrives.- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");for (let step = 0; step < 3; step++)await internals.wheelThroughUIProcess(50, 50, 0, 50, true, "ongoing");scroller.scrollTo({ top: 3000, behavior: "smooth" });diff --git a/Tests/LibWeb/Text/input/async-scrolling/scrollend-of-a-box-flung-during-a-thumb-drag-of-another.html b/Tests/LibWeb/Text/input/async-scrolling/scrollend-of-a-box-flung-during-a-thumb-drag-of-another.htmlindex a05c65cfc81..3e245d2428f 100644--- a/Tests/LibWeb/Text/input/async-scrolling/scrollend-of-a-box-flung-during-a-thumb-drag-of-another.html+++ b/Tests/LibWeb/Text/input/async-scrolling/scrollend-of-a-box-flung-during-a-thumb-drag-of-another.html@@ -45,7 +45,7 @@await new Promise(resolve => setTimeout(resolve, 700));};const flick = async () => {- internals.wheelThroughUIProcess(250, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(250, 50, 0, 0, true, "ongoing");for (let step = 0; step < 3; step++)await internals.wheelThroughUIProcess(250, 50, 0, 50, true, "ongoing");};diff --git a/Tests/LibWeb/Text/input/async-scrolling/viewport-scroll-by-a-distance-while-zoomed.html b/Tests/LibWeb/Text/input/async-scrolling/viewport-scroll-by-a-distance-while-zoomed.htmlindex 7a6a81fe743..8d77c5f5ab9 100644--- a/Tests/LibWeb/Text/input/async-scrolling/viewport-scroll-by-a-distance-while-zoomed.html+++ b/Tests/LibWeb/Text/input/async-scrolling/viewport-scroll-by-a-distance-while-zoomed.html@@ -25,7 +25,7 @@// The compositor pans the zoomed visual viewport by 50 while the main thread is busy, so the main thread has not// heard of it when the page scrolls itself by 30. The visual viewport takes that from where the pan left it.- internals.wheelThroughUIProcess(50, 50, 0, 0, true, "began");+ await internals.wheelThroughUIProcess(50, 50, 0, 0, true, "ongoing");await animationFrame();await animationFrame();internals.wheelThroughUIProcess(50, 50, 0, 100, true, "ongoing");