OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <title>Test visibiblity of controls when focusing of <video></title> | 3 <title>Test visibiblity of controls when focusing of <video></title> |
4 <script src=video-test.js></script> | 4 <script src=video-test.js></script> |
5 <script src=media-controls.js></script> | 5 <script src=media-controls.js></script> |
6 <p> | 6 <p> |
7 Test that video controls re-appear when the media (<video>) element is focuse
d. | 7 Test that video controls re-appear when the media (<video>) element is focuse
d. |
8 </p> | 8 </p> |
9 <video controls autoplay src="content/test.ogv"></video> | 9 <video controls autoplay src="content/test.ogv"></video> |
10 <script> | 10 <script> |
11 var controls; | 11 var controls; |
12 var video = document.querySelector("video"); | 12 var video = document.querySelector("video"); |
13 | 13 |
14 video.addEventListener("playing", function() | 14 video.addEventListener("playing", function() |
15 { | 15 { |
16 runAfterControlsHidden(function() | 16 runAfterHideMediaControlsTimerFired(function() |
17 { | 17 { |
18 controls = mediaControlsButton(video, "panel"); | 18 controls = mediaControlsButton(video, "panel"); |
19 | 19 |
20 testExpected("getComputedStyle(controls).opacity", 0); | 20 testExpected("getComputedStyle(controls).opacity", 0); |
21 video.focus(); | 21 video.focus(); |
22 | 22 |
23 testExpected("getComputedStyle(controls).opacity", 1); | 23 testExpected("getComputedStyle(controls).opacity", 1); |
24 | 24 |
25 // We fade out when focus is lost, so the opacity is still 1 | 25 // We fade out when focus is lost, so the opacity is still 1 |
26 video.blur(); | 26 video.blur(); |
27 testExpected("getComputedStyle(controls).opacity", 1); | 27 testExpected("getComputedStyle(controls).opacity", 1); |
28 | 28 |
29 endTest(); | 29 endTest(); |
30 }, video); | 30 }, video); |
31 }); | 31 }); |
32 </script> | 32 </script> |
OLD | NEW |