OLD | NEW |
---|---|
1 <script src="media-controls.js"></script> | |
1 <body> | 2 <body> |
2 <p> | 3 <p> |
3 This tests that audio controls do not fade out when the audio is playing. | 4 This tests that audio controls do not fade out when the audio is playing. |
4 </p> | 5 </p> |
5 <p id="result"> | 6 <p id="result"> |
6 FAIL: Test did not run. | 7 FAIL: Test did not run. |
7 </p> | 8 </p> |
8 <audio id="audio" controls autoplay onplaying="playing()" src="content/silence.w av"></audio><br> | 9 <audio id="audio" controls autoplay src="content/test.oga"></audio><br> |
acolwell GONE FROM CHROMIUM
2014/05/22 00:17:02
Changed to a file longer than 3 seconds so the con
| |
9 <script> | 10 <script> |
10 if (window.testRunner) { | 11 if (window.testRunner) { |
11 testRunner.waitUntilDone(); | 12 testRunner.waitUntilDone(); |
12 testRunner.dumpAsText(); | 13 testRunner.dumpAsText(); |
13 } | 14 } |
14 | 15 |
15 function playing() { | 16 document.getElementById("audio").addEventListener("timeupdate", function(e) |
16 setTimeout(function() { | 17 { |
17 var controls = internals.shadowRoot(document.getElementById("audio") ).firstChild.firstChild; | 18 if (e.target.currentTime < 4) { |
18 var opacity = getComputedStyle(controls).opacity; | 19 return; |
19 document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PASS"; | 20 } |
20 testRunner.notifyDone(); | 21 var controls = mediaControlsElement(internals.shadowRoot(e.target).first Child, "-webkit-media-controls-panel"); |
acolwell GONE FROM CHROMIUM
2014/05/22 00:17:02
The old code was looking at the wrong element whic
philipj_slow
2014/05/22 11:51:39
Interesting. I can see three other tests using the
| |
21 }, 250) | 22 var opacity = getComputedStyle(controls).opacity; |
22 } | 23 document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PA SS"; |
24 testRunner.notifyDone(); | |
25 }); | |
23 </script> | 26 </script> |
24 </body> | 27 </body> |
OLD | NEW |