-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
keyboard-scrolling-with-mouse-scroll.html
46 lines (36 loc) · 1.42 KB
/
keyboard-scrolling-with-mouse-scroll.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true EventHandlerDrivenSmoothKeyboardScrollingEnabled=true ] -->
<html>
<head>
<script src="../../../resources/ui-helper.js"></script>
<script src="../../../resources/js-test.js"></script>
<meta name="viewport" content="initial-scale=1.5, user-scalable=no">
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
async function runTest()
{
eventSender.monitorWheelEvents();
if (!window.testRunner || !testRunner.runUIScript)
return;
await UIHelper.rawKeyDown("downArrow");
setTimeout(async () => {
await UIHelper.rawKeyUp("downArrow");
const startingPosition = window.scrollY;
await UIHelper.mouseWheelScrollAt(0, 0, 0, 0, 0, 0);
const position = window.scrollY;
if (Math.abs(startingPosition - position) < 20)
debug("Successful.");
else
debug("Unsuccessful. window.scrollY after wheel event == " + position + "; window.scrollY before wheel event == " + startingPosition);
testRunner.notifyDone();
}, 100);
}
</script>
</head>
<body onload="runTest()">
<div style="height: 5000px;">
</div>
</body>
</html>