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 don't appear when the media (<video>) element is |
| 8 focused and the 'controls' attribute is not set. |
8 </p> | 9 </p> |
9 <video controls autoplay src="content/test.ogv"></video> | 10 <!-- 'tabindex' makes the video focusable despite it not having controls --> |
| 11 <video tabindex="0" autoplay src="content/test.ogv"></video> |
10 <script> | 12 <script> |
11 var controls; | 13 var controls; |
12 var video = document.querySelector("video"); | 14 var video = document.querySelector("video"); |
13 | 15 |
14 video.addEventListener("playing", function() | 16 video.addEventListener("playing", function() |
15 { | 17 { |
16 runAfterHideMediaControlsTimerFired(function() | 18 runAfterHideMediaControlsTimerFired(function() |
17 { | 19 { |
18 controls = mediaControlsButton(video, "panel"); | 20 controls = mediaControlsButton(video, "panel"); |
19 | 21 |
| 22 video.focus(); |
20 testExpected("getComputedStyle(controls).opacity", 0); | 23 testExpected("getComputedStyle(controls).opacity", 0); |
21 video.focus(); | |
22 | |
23 testExpected("getComputedStyle(controls).opacity", 1); | |
24 | |
25 // We fade out when focus is lost, so the opacity is still 1 | |
26 video.blur(); | |
27 testExpected("getComputedStyle(controls).opacity", 1); | |
28 | 24 |
29 endTest(); | 25 endTest(); |
30 }, video); | 26 }, video); |
31 }); | 27 }); |
32 </script> | 28 </script> |
OLD | NEW |