Skip to content

Commit

Permalink
LibWeb: Add a test for construction of WheelEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonbooth authored and kalenikaliaksandr committed May 12, 2024
1 parent 2e13165 commit 793cab7
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Tests/LibWeb/Text/expected/UIEvents/WheelEvent-construction.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
deltaX: 0
deltaY: 0
deltaZ: 0
deltaMode: 0
view: null
screenX: 0
screenY: 0
clientX: 0
clientY: 0
ctrlKey: false
altKey: false
shiftKey: false
metaKey: false

deltaX: 10
deltaY: 20
deltaZ: 35
deltaMode: 2
view: null
screenX: 1
screenY: 2
clientX: 3
clientY: 4
ctrlKey: true
altKey: true
shiftKey: false
metaKey: true
37 changes: 37 additions & 0 deletions Tests/LibWeb/Text/input/UIEvents/WheelEvent-construction.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script src="../include.js"></script>
<script>
function dumpWheelEvent(wheelEvent) {
println("deltaX: " + wheelEvent.deltaX);
println("deltaY: " + wheelEvent.deltaY);
println("deltaZ: " + wheelEvent.deltaZ);
println("deltaMode: " + wheelEvent.deltaMode);
println("view: " + wheelEvent.view);
println("screenX: " + wheelEvent.screenX);
println("screenY: " + wheelEvent.screenY);
println("clientX: " + wheelEvent.clientX);
println("clientY: " + wheelEvent.clientY);
println("ctrlKey: " + wheelEvent.ctrlKey);
println("altKey: " + wheelEvent.altKey);
println("shiftKey: " + wheelEvent.shiftKey);
println("metaKey: " + wheelEvent.metaKey);
}

test(() => {
dumpWheelEvent(new WheelEvent('wheel'));
println('');
dumpWheelEvent(new WheelEvent('wheel', {
deltaX: 10,
deltaY: 20,
deltaZ: 35,
deltaMode: WheelEvent.DOM_DELTA_PAGE,
screenX: 1,
screenY: 2,
clientX: 3,
clientY: 4,
ctrlKey: true,
altKey: true,
shiftKey: false,
metaKey: true,
}));
});
</script>

0 comments on commit 793cab7

Please sign in to comment.