Chromium Code Reviews| Index: LayoutTests/fast/events/gesture-pinch-zoom.html |
| diff --git a/LayoutTests/fast/events/gesture-pinch-zoom.html b/LayoutTests/fast/events/gesture-pinch-zoom.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b3ff81a305d915ed9e60f99e90724d654b94fe46 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/gesture-pinch-zoom.html |
| @@ -0,0 +1,42 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/js-test.js"></script> |
| +<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.
|
| +<script> |
| +var gotWheelEvent = false; |
| + |
| +function mouseWheel(event) |
| +{ |
| + shouldBeFalse('gotWheelEvent'); |
| + gotWheelEvent = true; |
| + 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.
|
| + event.preventDefault() |
| +} |
| + |
| +if (window.eventSender) { |
| + // Do a pinch in a region that prevents the event from propagating up to |
| + // do a zoom. |
| + shouldBe('window.innerWidth', '800'); |
| + shouldBe('window.innerHeight', '600'); |
| + eventSender.gesturePinchBegin('touchpad', 50, 50); |
| + eventSender.gesturePinchUpdate('touchpad', 50, 50, 2.0); |
| + eventSender.gesturePinchEnd('touchpad', 50, 50); |
| + shouldBe('window.innerWidth', '800'); |
| + shouldBe('window.innerHeight', '600'); |
| + shouldBe('window.scrollX', '0'); |
| + shouldBe('window.scrollY', '0'); |
| + shouldBeTrue('gotWheelEvent'); |
| + gotWheelEvent = false; |
| + |
| + // Do a pinch outside of this region and ensure that a zoom occurs, and |
| + // that it occurs around the pinch area. |
| + eventSender.gesturePinchBegin('touchpad', 150, 100); |
| + eventSender.gesturePinchUpdate('touchpad', 150, 100, 2.0); |
| + eventSender.gesturePinchEnd('touchpad', 150, 100); |
| + shouldBe('window.innerWidth', '400'); |
| + shouldBe('window.innerHeight', '300'); |
| + shouldBe('window.scrollX', '75'); |
| + shouldBe('window.scrollY', '50'); |
| + |
| + shouldBeFalse('gotWheelEvent'); |
| +} |
| +</script> |