OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <title>Test that video controls don't appear when the media element is focused a
nd the "controls" attribute is not set.</title> |
3 <title>Test visibiblity of controls when focusing of <video></title> | 3 <script src="../resources/testharness.js"></script> |
4 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 | 4 <script src="../resources/testharnessreport.js"></script> |
5 (Please avoid writing new tests using video-test.js) --> | 5 <script src="media-controls.js"></script> |
6 <script src=video-test.js></script> | 6 <script src="media-file.js"></script> |
7 <script src=media-controls.js></script> | 7 <!-- "tabindex" makes the video focusable despite it not having controls --> |
8 <p> | 8 <video tabindex="0"></video> |
9 Test that video controls don't appear when the media (<video>) element is | |
10 focused and the 'controls' attribute is not set. | |
11 </p> | |
12 <!-- 'tabindex' makes the video focusable despite it not having controls --> | |
13 <video tabindex="0" autoplay src="content/test.ogv"></video> | |
14 <script> | 9 <script> |
15 var controls; | 10 async_test(function(t) { |
16 var video = document.querySelector("video"); | 11 var video = document.querySelector("video"); |
17 | 12 |
18 video.addEventListener("playing", function() | 13 video.onplaying = t.step_func(function() { |
19 { | 14 runAfterHideMediaControlsTimerFired(t.step_func_done(function() { |
20 runAfterHideMediaControlsTimerFired(function() | 15 var controls = mediaControlsButton(video, "panel"); |
21 { | 16 video.focus(); |
22 controls = mediaControlsButton(video, "panel"); | 17 assert_equals(getComputedStyle(controls).opacity, "0"); |
| 18 }), video); |
| 19 }); |
23 | 20 |
24 video.focus(); | 21 video.src = findMediaFile("video", "content/test"); |
25 testExpected("getComputedStyle(controls).opacity", 0); | 22 video.play(); |
26 | |
27 endTest(); | |
28 }, video); | |
29 }); | 23 }); |
30 </script> | 24 </script> |
OLD | NEW |