OLD | NEW |
| 1 <script src="video-test.js"></script> |
1 <script src="media-controls.js"></script> | 2 <script src="media-controls.js"></script> |
2 <body> | 3 <body> |
3 <p> | 4 <p> |
4 This tests that audio controls do not fade out when the audio is playing. | 5 This tests that audio controls do not fade out when the audio is playing. |
5 </p> | 6 </p> |
6 <p id="result"> | 7 <audio id="audio" controls autoplay src="content/test.oga"></audio> |
7 FAIL: Test did not run. | |
8 </p> | |
9 <audio id="audio" controls autoplay src="content/test.oga"></audio><br> | |
10 <script> | 8 <script> |
| 9 var controls; |
| 10 |
11 if (window.testRunner) { | 11 if (window.testRunner) { |
12 testRunner.waitUntilDone(); | 12 testRunner.waitUntilDone(); |
13 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
14 } | 14 } |
15 | 15 |
16 document.getElementById("audio").addEventListener("timeupdate", function(e) | 16 var audio = document.getElementById("audio"); |
| 17 audio.addEventListener("playing", function() |
17 { | 18 { |
18 if (e.target.currentTime < 4) { | 19 runAfterControlsHidden(function() |
19 return; | 20 { |
20 } | 21 controls = mediaControlsButton(audio, "panel"); |
21 var controls = mediaControlsElement(internals.shadowRoot(e.target).first
Child, "-webkit-media-controls-panel"); | 22 testExpected("getComputedStyle(controls).opacity", 1); |
22 var opacity = getComputedStyle(controls).opacity; | 23 |
23 document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PA
SS"; | 24 consoleWrite(""); |
24 testRunner.notifyDone(); | 25 endTest(); |
| 26 }, audio); |
25 }); | 27 }); |
26 </script> | 28 </script> |
27 </body> | 29 </body> |
OLD | NEW |