OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <style> |
| 4 #no-video-media { |
| 5 width: 320px; |
| 6 height: 240px; |
| 7 } |
| 8 </style> |
| 9 <script src=video-test.js></script> |
| 10 <script src=media-file.js></script> |
| 11 <script src=media-controls.js></script> |
| 12 <script> |
| 13 var controls; |
| 14 |
| 15 function runTest() |
| 16 { |
| 17 video = document.getElementById("no-video-media"); |
| 18 |
| 19 testExpected("video.paused", true); |
| 20 if (!window.testRunner) |
| 21 return; |
| 22 |
| 23 if (!window.internals || !window.internals.setIsCursorVisible) { |
| 24 debug("window.internals.setIsCursorVisible is required to run this test.
"); |
| 25 return; |
| 26 } |
| 27 |
| 28 // Hover the control with the mouse. |
| 29 var coords = mediaControlsButtonCoordinates(video, "play-button"); |
| 30 eventSender.mouseMoveTo(coords[0], coords[1]); |
| 31 |
| 32 // And then tap (touch input) the play button. |
| 33 eventSender.gestureTapDown(coords[0], coords[1]); |
| 34 eventSender.gestureShowPress(coords[0], coords[1]); |
| 35 eventSender.gestureTap(coords[0], coords[1]); |
| 36 testExpected("video.paused", false); |
| 37 |
| 38 // In the real world Chromium hides the cursor after a tap, |
| 39 // so hide it manually here. This is required to hit the |
| 40 // early out from EventHandler::fakeMouseMoveEventTimerFired when |
| 41 // isCursorVisible is false. |
| 42 internals.setIsCursorVisible(document, false); |
| 43 |
| 44 // And the controls should hide after a timeout. |
| 45 runAfterHideMediaControlsTimerFired(function() |
| 46 { |
| 47 controls = mediaControlsButton(video, "panel"); |
| 48 testExpected("getComputedStyle(controls).opacity", 0); |
| 49 endTest(); |
| 50 }, video); |
| 51 |
| 52 } |
| 53 </script> |
| 54 <body> |
| 55 <p>Test video element control visibility with multimodal input. The controls |
| 56 should hide after a timeout if the last input event was a tap.</p> |
| 57 <p>This test only runs in DRT!</p> |
| 58 |
| 59 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide
o> |
| 60 <script> |
| 61 setSrcById("no-video-media", findMediaFile("video", "content/test")); |
| 62 </script> |
| 63 </body> |
| 64 </html> |
OLD | NEW |