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 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
7 <script src=../fullscreen/full-screen-test.js></script> | 7 <script src=../fullscreen/full-screen-test.js></script> |
8 <script> | 8 <script> |
9 var panel; | 9 var panel; |
10 var playButtonCoordinates; | 10 var playButtonCoordinates; |
11 var fadeoutTime = 3500; | |
12 var count = 0; | 11 var count = 0; |
13 | 12 |
14 function init() | 13 function init() |
15 { | 14 { |
16 findMediaElement(); | 15 findMediaElement(); |
17 waitForEvent(video, 'canplaythrough', oncanplaythrough); | 16 waitForEvent(video, 'canplaythrough', oncanplaythrough); |
18 video.src = findMediaFile('video', 'content/test'); | 17 video.src = findMediaFile('video', 'content/test'); |
19 } | 18 } |
20 | 19 |
21 function oncanplaythrough() | 20 function oncanplaythrough() |
22 { | 21 { |
23 waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange); | 22 waitForEvent(video, 'webkitfullscreenchange', onfullscreenchange); |
24 | 23 |
25 panel = mediaControlsElement(internals.shadowRoot(video).firstChild,
"-webkit-media-controls-panel"); | 24 panel = mediaControlsButton(video, "panel"); |
26 if (window.eventSender) { | 25 if (window.eventSender) { |
27 try { | 26 try { |
28 playButtonCoordinates = mediaControlsButtonCoordinates(video
, "play-button"); | 27 playButtonCoordinates = mediaControlsButtonCoordinates(video
, "play-button"); |
29 } catch (exception) { | 28 } catch (exception) { |
30 testRunner.notifyDone(); | 29 testRunner.notifyDone(); |
31 return; | 30 return; |
32 } | 31 } |
33 var x = playButtonCoordinates[0]; | 32 var x = playButtonCoordinates[0]; |
34 var y = playButtonCoordinates[1]; | 33 var y = playButtonCoordinates[1]; |
35 | 34 |
36 consoleWrite("** Move mouse to the play button and start playing
the video **"); | 35 consoleWrite("** Move mouse to the play button and start playing
the video **"); |
37 eventSender.mouseMoveTo(x, y); | 36 eventSender.mouseMoveTo(x, y); |
38 eventSender.mouseDown(); | 37 eventSender.mouseDown(); |
39 eventSender.mouseUp(); | 38 eventSender.mouseUp(); |
40 consoleWrite(""); | 39 consoleWrite(""); |
41 } | 40 } |
42 | 41 |
43 consoleWrite("** Test that controls are shown when controls attribut
e is present **"); | 42 consoleWrite("** Test that controls are shown when controls attribut
e is present **"); |
44 var opacity = getComputedStyle(panel).opacity; | 43 var opacity = getComputedStyle(panel).opacity; |
45 if (opacity < 1) | 44 if (opacity < 1) |
46 failTest("Media control is not opaque."); | 45 failTest("Media control is not opaque."); |
47 else | 46 else |
48 runWithKeyDown(function(){ video.webkitRequestFullscreen(); }); | 47 runWithKeyDown(function(){ video.webkitRequestFullscreen(); }); |
49 } | 48 } |
50 | 49 |
51 function onfullscreenchange() | 50 function onfullscreenchange() |
52 { | 51 { |
53 switch (count) { | 52 switch (count) { |
54 case 0: | 53 case 0: |
55 setTimeout(continueTest, fadeoutTime); | 54 runAfterControlsHidden(continueTest, video); |
56 break; | 55 break; |
57 case 1: | 56 case 1: |
58 consoleWrite(""); | 57 consoleWrite(""); |
59 consoleWrite("** The controls should be shown after exiting
the fullscreen"); | 58 consoleWrite("** The controls should be shown after exiting
the fullscreen"); |
60 var opacity = getComputedStyle(panel).opacity; | 59 var opacity = getComputedStyle(panel).opacity; |
61 if (opacity < 1) | 60 if (opacity < 1) |
62 failTest("Media control is not opaque."); | 61 failTest("Media control is not opaque."); |
63 else | 62 else |
64 endTest(); | 63 endTest(); |
65 } | 64 } |
66 count++; | 65 count++; |
67 } | 66 } |
68 | 67 |
69 function continueTest() | 68 function continueTest() |
70 { | 69 { |
71 consoleWrite(""); | 70 consoleWrite(""); |
72 run("document.webkitExitFullscreen()"); | 71 run("document.webkitExitFullscreen()"); |
73 } | 72 } |
74 | 73 |
75 </script> | 74 </script> |
76 </head> | 75 </head> |
77 <body onload="init()"> | 76 <body onload="init()"> |
78 Tests that video controls are shwon after exiting fullscreen<br> | 77 Tests that video controls are shwon after exiting fullscreen<br> |
79 <video controls></video> | 78 <video controls></video> |
80 </body> | 79 </body> |
81 </html> | 80 </html> |
82 | 81 |
OLD | NEW |