Chromium Code Reviews| Index: LayoutTests/fast/events/touch/touch-tilt.html | 
| diff --git a/LayoutTests/fast/events/touch/touch-tilt.html b/LayoutTests/fast/events/touch/touch-tilt.html | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..5515e5cd38d662dd1b5470504ee3505088afa418 | 
| --- /dev/null | 
| +++ b/LayoutTests/fast/events/touch/touch-tilt.html | 
| @@ -0,0 +1,48 @@ | 
| +<script src="../../../resources/js-test.js"></script> | 
| + | 
| +<p id="description"></p> | 
| +<div id="console"></div> | 
| +<script type="text/javascript"> | 
| +description('Test verifies tilt and tiltDirection can be plumbed through correctly via eventSender'); | 
| + | 
| +var touch = null; | 
| + | 
| +document.addEventListener('touchmove', function(event) { | 
| + shouldBeNull('touch'); | 
| + touch = event.touches.item(0); | 
| 
 
Rick Byers
2015/03/17 14:38:48
nit: touches is an array, so access to item 0 is a
 
d.pikalov
2015/03/17 16:15:51
Done.
 
 | 
| +}, false); | 
| + | 
| +if (window.eventSender) { | 
| + eventSender.clearTouchPoints(); | 
| + eventSender.addTouchPoint(100, 100); | 
| + eventSender.touchStart(); | 
| + touch = null; | 
| + | 
| + eventSender.updateTouchPoint(0, 110, 110); | 
| + debug('Sending touchmove (1)'); | 
| + eventSender.touchMove(); | 
| + shouldBeNonNull('touch'); | 
| + shouldBeNaN('touch.tilt'); | 
| + shouldBeNaN('touch.tiltDirection'); | 
| + touch = null; | 
| + | 
| + eventSender.clearTouchPoints(); | 
| 
 
Rick Byers
2015/03/17 14:38:48
you should probably call evendSender.touchEnd() he
 
d.pikalov
2015/03/17 16:15:51
Done.
 
 | 
| + eventSender.addTouchPoint(100, 100); | 
| + if (eventSender.setTouchPointTilt) | 
| + eventSender.setTouchPointTilt(0, 10, 10, false); | 
| + eventSender.touchStart(); | 
| 
 
Rick Byers
2015/03/17 14:38:47
you should verify the tilt after touchstart too -
 
d.pikalov
2015/03/17 16:15:51
Done.
 
 | 
| + touch = null; | 
| + | 
| + if (eventSender.setTouchPointTilt) | 
| + eventSender.setTouchPointTilt(0, 45, 60, true); | 
| + debug('Sending touchmove (2)'); | 
| + eventSender.touchMove(); | 
| + shouldBeNonNull('touch'); | 
| + shouldBe('touch.tilt', '45'); | 
| + shouldBe('touch.tiltDirection', '60'); | 
| + touch = null; | 
| +} else { | 
| + debug('This test requires --dump-render-tree.'); | 
| +} | 
| + | 
| +</script> |