 Chromium Code Reviews
 Chromium Code Reviews Issue 750013004:
  Added experimental tilt and tiltDirection to the Touch interface  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 750013004:
  Added experimental tilt and tiltDirection to the Touch interface  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 <script src="../../../resources/js-test.js"></script> | |
| 2 | |
| 3 <p id="description"></p> | |
| 4 <div id="console"></div> | |
| 5 <script type="text/javascript"> | |
| 6 description('Test verifies tilt and tiltDirection can be plumbed through correct ly via eventSender'); | |
| 7 | |
| 8 var touch = null; | |
| 9 | |
| 10 document.addEventListener('touchmove', function(event) { | |
| 11 shouldBeNull('touch'); | |
| 12 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.
 | |
| 13 }, false); | |
| 14 | |
| 15 if (window.eventSender) { | |
| 16 eventSender.clearTouchPoints(); | |
| 17 eventSender.addTouchPoint(100, 100); | |
| 18 eventSender.touchStart(); | |
| 19 touch = null; | |
| 20 | |
| 21 eventSender.updateTouchPoint(0, 110, 110); | |
| 22 debug('Sending touchmove (1)'); | |
| 23 eventSender.touchMove(); | |
| 24 shouldBeNonNull('touch'); | |
| 25 shouldBeNaN('touch.tilt'); | |
| 26 shouldBeNaN('touch.tiltDirection'); | |
| 27 touch = null; | |
| 28 | |
| 29 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.
 | |
| 30 eventSender.addTouchPoint(100, 100); | |
| 31 if (eventSender.setTouchPointTilt) | |
| 32 eventSender.setTouchPointTilt(0, 10, 10, false); | |
| 33 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.
 | |
| 34 touch = null; | |
| 35 | |
| 36 if (eventSender.setTouchPointTilt) | |
| 37 eventSender.setTouchPointTilt(0, 45, 60, true); | |
| 38 debug('Sending touchmove (2)'); | |
| 39 eventSender.touchMove(); | |
| 40 shouldBeNonNull('touch'); | |
| 41 shouldBe('touch.tilt', '45'); | |
| 42 shouldBe('touch.tiltDirection', '60'); | |
| 43 touch = null; | |
| 44 } else { | |
| 45 debug('This test requires --dump-render-tree.'); | |
| 46 } | |
| 47 | |
| 48 </script> | |
| OLD | NEW |