OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <title>Test rendering of video control after exiting fullscreen</title> | 3 <title>Test rendering of video control after exiting fullscreen</title> |
4 <script src=media-file.js></script> | 4 <script src=media-file.js></script> |
5 <script src=media-controls.js></script> | 5 <script src=media-controls.js></script> |
| 6 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 7 (Please avoid writing new tests using video-test.js) --> |
6 <script src=video-test.js></script> | 8 <script src=video-test.js></script> |
7 <script src=../fullscreen/full-screen-test.js></script> | 9 <script src=../fullscreen/full-screen-test.js></script> |
8 <script> | 10 <script> |
9 var panel; | 11 var panel; |
10 var playButtonCoordinates; | 12 var playButtonCoordinates; |
11 var count = 0; | 13 var count = 0; |
12 | 14 |
13 function init() | 15 function init() |
14 { | 16 { |
15 findMediaElement(); | 17 findMediaElement(); |
16 waitForEvent(video, 'canplaythrough', oncanplaythrough); | 18 waitForEvent(video, 'canplaythrough', oncanplaythrough); |
17 video.src = findMediaFile('video', 'content/test'); | 19 video.src = findMediaFile('video', 'content/test'); |
18 } | 20 } |
19 | 21 |
20 function oncanplaythrough() | 22 function oncanplaythrough() |
21 { | 23 { |
22 waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange); | 24 waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange); |
23 | 25 |
24 panel = mediaControlsButton(video, "panel"); | 26 panel = mediaControlsButton(video, "panel"); |
25 if (window.eventSender) { | 27 if (window.eventSender) { |
26 try { | 28 try { |
27 playButtonCoordinates = mediaControlsButtonCoordinates(video
, "play-button"); | 29 playButtonCoordinates = mediaControlsButtonCoordinates(video
, "play-button"); |
28 } catch (exception) { | 30 } catch (exception) { |
29 testRunner.notifyDone(); | 31 testRunner.notifyDone(); |
30 return; | 32 return; |
31 } | 33 } |
32 var x = playButtonCoordinates[0]; | 34 var x = playButtonCoordinates[0]; |
33 var y = playButtonCoordinates[1]; | 35 var y = playButtonCoordinates[1]; |
34 | 36 |
35 consoleWrite("** Move mouse to the play button and start playing
the video **"); | 37 consoleWrite("** Move mouse to the play button and start playing
the video **"); |
36 eventSender.mouseMoveTo(x, y); | 38 eventSender.mouseMoveTo(x, y); |
37 eventSender.mouseDown(); | 39 eventSender.mouseDown(); |
38 eventSender.mouseUp(); | 40 eventSender.mouseUp(); |
39 consoleWrite(""); | 41 consoleWrite(""); |
40 } | 42 } |
41 | 43 |
42 consoleWrite("** Test that controls are shown when controls attribut
e is present **"); | 44 consoleWrite("** Test that controls are shown when controls attribut
e is present **"); |
43 var opacity = getComputedStyle(panel).opacity; | 45 var opacity = getComputedStyle(panel).opacity; |
44 if (opacity < 1) | 46 if (opacity < 1) |
45 failTest("Media control is not opaque."); | 47 failTest("Media control is not opaque."); |
(...skipping 25 matching lines...) Expand all Loading... |
71 run("document.webkitExitFullscreen()"); | 73 run("document.webkitExitFullscreen()"); |
72 } | 74 } |
73 | 75 |
74 </script> | 76 </script> |
75 </head> | 77 </head> |
76 <body onload="init()"> | 78 <body onload="init()"> |
77 Tests that video controls are shwon after exiting fullscreen<br> | 79 Tests that video controls are shwon after exiting fullscreen<br> |
78 <video controls></video> | 80 <video controls></video> |
79 </body> | 81 </body> |
80 </html> | 82 </html> |
81 | |
OLD | NEW |