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 ff5bd6e065bf2a292b773458aec852410d553cc9..ca23727921ccdff4582d49ed688b447f8df3a855 100644 |
--- a/LayoutTests/media/audio-controls-do-not-fade-out.html |
+++ b/LayoutTests/media/audio-controls-do-not-fade-out.html |
@@ -1,27 +1,29 @@ |
+<script src="video-test.js"></script> |
<script src="media-controls.js"></script> |
<body> |
<p> |
This tests that audio controls do not fade out when the audio is playing. |
</p> |
-<p id="result"> |
- FAIL: Test did not run. |
-</p> |
-<audio id="audio" controls autoplay src="content/test.oga"></audio><br> |
+<audio id="audio" controls autoplay src="content/test.oga"></audio> |
<script> |
+ var controls; |
+ |
if (window.testRunner) { |
testRunner.waitUntilDone(); |
testRunner.dumpAsText(); |
} |
- document.getElementById("audio").addEventListener("timeupdate", function(e) |
+ var audio = document.getElementById("audio"); |
+ audio.addEventListener("playing", function() |
{ |
- if (e.target.currentTime < 4) { |
- return; |
- } |
- var controls = mediaControlsElement(internals.shadowRoot(e.target).firstChild, "-webkit-media-controls-panel"); |
- var opacity = getComputedStyle(controls).opacity; |
- document.getElementById("result").innerText = opacity < 1 ? "FAIL" : "PASS"; |
- testRunner.notifyDone(); |
+ runAfterControlsHidden(function() |
+ { |
+ controls = mediaControlsButton(audio, "panel"); |
+ testExpected("getComputedStyle(controls).opacity", 1); |
+ |
+ consoleWrite(""); |
+ endTest(); |
+ }, audio); |
}); |
</script> |
</body> |