Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/js-test.js"></script> | |
| 3 <div onmousewheel="mouseWheel(event)" style="margin: 0px 0; width: 100px; height : 100px; background-color: blue;"></div> | |
|
Rick Byers
2015/02/04 01:31:40
nit: use 'onwheel' instead of 'onmousewheel'. 'mo
ccameron
2015/02/04 02:01:02
Done.
| |
| 4 <script> | |
| 5 var gotWheelEvent = false; | |
| 6 | |
| 7 function mouseWheel(event) | |
| 8 { | |
| 9 shouldBeFalse('gotWheelEvent'); | |
| 10 gotWheelEvent = true; | |
| 11 shouldBeTrue('event.ctrlKey'); | |
|
Rick Byers
2015/02/04 01:31:40
nit: Please also validate the co-ordinates and the
ccameron
2015/02/04 02:01:02
Done.
| |
| 12 event.preventDefault() | |
| 13 } | |
| 14 | |
| 15 if (window.eventSender) { | |
| 16 // Do a pinch in a region that prevents the event from propagating up to | |
| 17 // do a zoom. | |
| 18 shouldBe('window.innerWidth', '800'); | |
| 19 shouldBe('window.innerHeight', '600'); | |
| 20 eventSender.gesturePinchBegin('touchpad', 50, 50); | |
| 21 eventSender.gesturePinchUpdate('touchpad', 50, 50, 2.0); | |
| 22 eventSender.gesturePinchEnd('touchpad', 50, 50); | |
| 23 shouldBe('window.innerWidth', '800'); | |
| 24 shouldBe('window.innerHeight', '600'); | |
| 25 shouldBe('window.scrollX', '0'); | |
| 26 shouldBe('window.scrollY', '0'); | |
| 27 shouldBeTrue('gotWheelEvent'); | |
| 28 gotWheelEvent = false; | |
| 29 | |
| 30 // Do a pinch outside of this region and ensure that a zoom occurs, and | |
| 31 // that it occurs around the pinch area. | |
| 32 eventSender.gesturePinchBegin('touchpad', 150, 100); | |
| 33 eventSender.gesturePinchUpdate('touchpad', 150, 100, 2.0); | |
| 34 eventSender.gesturePinchEnd('touchpad', 150, 100); | |
| 35 shouldBe('window.innerWidth', '400'); | |
| 36 shouldBe('window.innerHeight', '300'); | |
| 37 shouldBe('window.scrollX', '75'); | |
| 38 shouldBe('window.scrollY', '50'); | |
| 39 | |
| 40 shouldBeFalse('gotWheelEvent'); | |
| 41 } | |
| 42 </script> | |
| OLD | NEW |