blob: b928213ccffe5c63031c09b085b33911c87ab86f [file] [log] [blame]
<html>
<head>
<style>
#scrolly {
height: 400px;
width: 200px;
border: 1px solid blue;
overflow-x: hidden;
overflow-y: auto;
}
#content {
height: 2000px;
}
</style>
<script src="../../resources/js-test-pre.js"></script>
<script>
var deltaOfZero = false;
function checkForZero()
{
if (deltaOfZero)
testFailed("Wheel events with zero delta were sent to the DOM. ");
else
testPassed("Wheel events with delta of zero were not sent to the DOM.");
testRunner.notifyDone();
}
function didScroll(event) {
if (event.wheelDeltaX == 0 && event.wheelDeltaY == 0)
deltaOfZero = true;
}
function scrollTest()
{
var startPosX = 100;
var startPosY = 100;
eventSender.mouseMoveTo(startPosX, startPosY);
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'began', 'none');
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'changed', 'none');
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'ended', 'none');
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'begin');
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, -1, 'none', 'continue');
eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, 'none', 'end');
eventSender.callAfterScrollingCompletes(checkForZero);
}
function setUp() {
var scrolly = document.getElementById("scrolly");
scrolly.addEventListener("mousewheel", didScroll);
if (window.eventSender) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
eventSender.monitorWheelEvents();
setTimeout(scrollTest, 0);
}
}
</script>
</head>
<body onload="setUp();">
<div id="scrolly">
<div id="content"></div>
</div>
</body>
</html>