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