Chromium Code Reviews| Index: LayoutTests/fast/events/wheelevent-mousewheel-interaction.html |
| diff --git a/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html b/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..810fe0b6b1ce960de5bea8dac9a5bfbbc02ecdfc |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html |
| @@ -0,0 +1,55 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent"> |
| +<script src="../js/resources/js-test-pre.js"></script> |
| +<script> |
| +function runTest() { |
| + var div = document.getElementById('target'); |
| + div.addEventListener('wheel', wheelHandler); |
| + div.addEventListener('mousewheel', mouseWheelHandler); |
| + if (window.eventSender) { |
| + eventSender.mouseMoveTo(div.offsetLeft + 5, div.offsetTop + 5); |
| + eventSender.mouseScrollBy(10, 20); |
| + setTimeout(finishJSTest, 0); |
|
arv (Not doing code reviews)
2013/08/16 14:19:27
Is this because scroll events are async?
do-not-use
2013/08/16 15:24:10
I don't think this is needed actually. I'll check.
|
| + } else { |
| + debug("FAIL: This test requires window.eventSender."); |
| + finishJSTest(); |
| + } |
| +} |
| + |
| +var testEvent; |
| +function wheelHandler(e) { |
| + testEvent = e; |
| + testPassed("Standard wheel event was fired."); |
| + shouldBe("testEvent.__proto__", "WheelEvent.prototype"); |
| +} |
| + |
| +function mouseWheelHandler(e) { |
| + testFailed("mousewheel event should not have fired."); |
| +} |
| + |
| +</script> |
| +</head> |
| +<body> |
| +<span id="parent"> |
| + <div id="target" style="border:solid 1px green; width:220px; height:70px; overflow:scroll"> |
| + TOP TOP TOP TOP TOP TOP TOP |
| + Scroll mouse wheel over here |
| + Scroll mouse wheel over here |
| + Scroll mouse wheel over here |
| + Scroll mouse wheel over here |
| + Scroll mouse wheel over here |
| + Scroll mouse wheel over here |
| + END END END END END END END |
| + </div> |
| +</span> |
| +<script> |
| +description("Tests the interaction between the standard 'wheel' event and the non-standard 'mousewheel' one"); |
| +window.jsTestIsAsync = true; |
| + |
| +runTest(); |
| +</script> |
| +<script src="../js/resources/js-test-post.js"></script> |
| +</body> |
| +</html> |