Chromium Code Reviews| Index: LayoutTests/media/audio-controls-do-not-fade-out.html |
| diff --git a/LayoutTests/media/audio-controls-do-not-fade-out.html b/LayoutTests/media/audio-controls-do-not-fade-out.html |
| index 29dc40042883c22837e1fc5359771be66a208dd8..ff5bd6e065bf2a292b773458aec852410d553cc9 100644 |
| --- a/LayoutTests/media/audio-controls-do-not-fade-out.html |
| +++ b/LayoutTests/media/audio-controls-do-not-fade-out.html |
| @@ -1,3 +1,4 @@ |
| +<script src="media-controls.js"></script> |
| <body> |
| <p> |
| This tests that audio controls do not fade out when the audio is playing. |
| @@ -5,20 +6,22 @@ |
| <p id="result"> |
| FAIL: Test did not run. |
| </p> |
| -<audio id="audio" controls autoplay onplaying="playing()" src="content/silence.wav"></audio><br> |
| +<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
|
| <script> |
| if (window.testRunner) { |
| testRunner.waitUntilDone(); |
| testRunner.dumpAsText(); |
| } |
| - function playing() { |
| - setTimeout(function() { |
| - var controls = internals.shadowRoot(document.getElementById("audio")).firstChild.firstChild; |
| - var opacity = getComputedStyle(controls).opacity; |
| - document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PASS"; |
| - testRunner.notifyDone(); |
| - }, 250) |
| - } |
| + document.getElementById("audio").addEventListener("timeupdate", function(e) |
| + { |
| + if (e.target.currentTime < 4) { |
| + return; |
| + } |
| + var controls = mediaControlsElement(internals.shadowRoot(e.target).firstChild, "-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
|
| + var opacity = getComputedStyle(controls).opacity; |
| + document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PASS"; |
| + testRunner.notifyDone(); |
| + }); |
| </script> |
| </body> |