OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 |
| 5 </head> |
| 6 <body> |
| 7 <video controls></video> |
| 8 <p>This tests that touch events on the controls will not be seen by the vide
o element.</p> |
| 9 <script src=media-file.js></script> |
| 10 <script src=video-test.js></script> |
| 11 <script src=media-controls.js></script> |
| 12 <script> |
| 13 waitForEventAndFail("click"); |
| 14 waitForEventAndFail("dblclick"); |
| 15 waitForEventAndFail("touchstart"); |
| 16 waitForEventAndFail("touchend"); |
| 17 waitForEventAndFail("touchmove"); |
| 18 |
| 19 waitForEventAndEnd("loadeddata", function() |
| 20 { |
| 21 if (window.eventSender) { |
| 22 // click the play button |
| 23 var coords = mediaControlsButtonCoordinates(video, "play-button"
); |
| 24 eventSender.addTouchPoint(coords[0], coords[1]); |
| 25 |
| 26 eventSender.touchStart(); |
| 27 eventSender.leapForward(100); |
| 28 eventSender.touchEnd(); |
| 29 eventSender.cancelTouchPoint(0); |
| 30 |
| 31 // Click the current time display, which should not respond to e
vents, but |
| 32 // should still capture them |
| 33 coords = mediaControlsButtonCoordinates(video, "current-time-dis
play"); |
| 34 eventSender.addTouchPoint(coords[0], coords[1]); |
| 35 |
| 36 eventSender.touchStart(); |
| 37 eventSender.leapForward(100); |
| 38 eventSender.touchEnd(); |
| 39 eventSender.cancelTouchPoint(0); |
| 40 |
| 41 |
| 42 // Click the timeline - this tests that multilevel shadow DOM el
ements work |
| 43 coords = mediaControlsButtonCoordinates(video, "timeline"); |
| 44 eventSender.addTouchPoint(coords[0], coords[1]); |
| 45 |
| 46 eventSender.touchStart(); |
| 47 eventSender.leapForward(100); |
| 48 eventSender.touchEnd(); |
| 49 |
| 50 // Check that the timeline also captures moves |
| 51 eventSender.updateTouchPoint(0, coords[0]+10, coords[1]+10) |
| 52 eventSender.touchMove(); |
| 53 eventSender.cancelTouchPoint(0); |
| 54 |
| 55 } |
| 56 }); |
| 57 video.src = findMediaFile("video", "content/test"); |
| 58 </script> |
| 59 </body> |
| 60 </html> |
OLD | NEW |