| 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 <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956 |
| 5 (Please avoid writing new tests using video-test.js) --> |
| 4 <script src=video-test.js></script> | 6 <script src=video-test.js></script> |
| 5 <script src=media-controls.js></script> | 7 <script src=media-controls.js></script> |
| 6 <p> | 8 <p> |
| 7 Test that video controls re-appear when the media (<video>) element is focuse
d. | 9 Test that video controls re-appear when the media (<video>) element is focuse
d. |
| 8 </p> | 10 </p> |
| 9 <video controls autoplay src="content/test.ogv"></video> | 11 <video controls 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 |
| 20 testExpected("getComputedStyle(controls).opacity", 0); | 22 testExpected("getComputedStyle(controls).opacity", 0); |
| 21 video.focus(); | 23 video.focus(); |
| 22 | 24 |
| 23 testExpected("getComputedStyle(controls).opacity", 1); | 25 testExpected("getComputedStyle(controls).opacity", 1); |
| 24 | 26 |
| 25 // We fade out when focus is lost, so the opacity is still 1 | 27 // We fade out when focus is lost, so the opacity is still 1 |
| 26 video.blur(); | 28 video.blur(); |
| 27 testExpected("getComputedStyle(controls).opacity", 1); | 29 testExpected("getComputedStyle(controls).opacity", 1); |
| 28 | 30 |
| 29 endTest(); | 31 endTest(); |
| 30 }, video); | 32 }, video); |
| 31 }); | 33 }); |
| 32 </script> | 34 </script> |
| OLD | NEW |