OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <style> | 3 <style> |
4 #no-video-media { | 4 #no-video-media { |
5 width: 320px; | 5 width: 320px; |
6 height: 240px; | 6 height: 240px; |
7 } | 7 } |
8 </style> | 8 </style> |
9 <script src=video-test.js></script> | 9 <script src=video-test.js></script> |
10 <script src=media-file.js></script> | 10 <script src=media-file.js></script> |
11 <script src=media-controls.js></script> | 11 <script src=media-controls.js></script> |
12 <script> | 12 <script> |
13 var controls; | 13 var controls; |
14 | 14 |
15 function runTest() | 15 function runTest() |
16 { | 16 { |
17 video = document.getElementById("no-video-media"); | 17 video = document.getElementById("no-video-media"); |
18 | 18 |
19 testExpected("video.paused", true); | 19 testExpected("video.paused", true); |
20 if (!window.testRunner) | 20 if (!window.testRunner) |
21 return; | 21 return; |
22 | 22 |
23 // Click the play button. | 23 // Tap the play button |
24 var playCoords = mediaControlsButtonCoordinates(video, "play-button"); | 24 var coords = mediaControlsButtonCoordinates(video, "play-button"); |
25 var clickX = playCoords[0]; | 25 eventSender.gestureTapDown(coords[0], coords[1]); |
26 var clickY = playCoords[1]; | 26 eventSender.gestureShowPress(coords[0], coords[1]); |
27 eventSender.mouseMoveTo(clickX, clickY); | 27 eventSender.gestureTap(coords[0], coords[1]); |
28 eventSender.mouseDown(); | |
29 eventSender.mouseUp(); | |
30 testExpected("video.paused", false); | 28 testExpected("video.paused", false); |
31 | 29 |
32 runAfterHideMediaControlsTimerFired(function() | 30 runAfterHideMediaControlsTimerFired(function() |
33 { | 31 { |
34 controls = mediaControlsButton(video, "panel"); | 32 controls = mediaControlsButton(video, "panel"); |
35 testExpected("getComputedStyle(controls).opacity", 0); | 33 testExpected("getComputedStyle(controls).opacity", 0); |
36 | 34 |
37 consoleWrite(""); | 35 consoleWrite(""); |
38 endTest(); | 36 endTest(); |
39 }, video); | 37 }, video); |
40 } | 38 } |
41 </script> | 39 </script> |
42 <body> | 40 <body> |
43 <p>Test video element control visibility after touch on control. After a del
ay the | 41 <p>Test video element control visibility after touch on control. After a del
ay the |
44 controls must be hidden.</p> | 42 controls must be hidden.</p> |
45 <p>This test only runs in DRT!</p> | 43 <p>This test only runs in DRT!</p> |
46 | 44 |
47 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide
o> | 45 <video id="no-video-media" controls loop oncanplaythrough="runTest()"></vide
o> |
48 <script> | 46 <script> |
49 window.internals.settings.setDeviceSupportsMouse(false); | |
50 setSrcById("no-video-media", findMediaFile("video", "content/test")); | 47 setSrcById("no-video-media", findMediaFile("video", "content/test")); |
51 </script> | 48 </script> |
52 </body> | 49 </body> |
53 </html> | 50 </html> |
OLD | NEW |