Index: third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html |
diff --git a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html |
index 4a7148796859a1a949a4b395d0f3a495f9292779..920ae6792f5d599dd03f32af9f158943f9738253 100644 |
--- a/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html |
+++ b/third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html |
@@ -1,31 +1,21 @@ |
-<!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956 |
- (Please avoid writing new tests using video-test.js) --> |
-<script src="video-test.js"></script> |
+<!DOCTYPE html> |
+<title>This tests that audio controls do not fade out when the audio is playing.</title> |
+<script src="media-file.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> |
-<audio id="audio" controls autoplay src="content/test.oga"></audio> |
+<script src="../resources/testharness.js"></script> |
+<script src="../resources/testharnessreport.js"></script> |
+<audio controls autoplay></audio> |
<script> |
- var controls; |
+async_test(function(t) { |
+ var audio = document.querySelector("audio"); |
+ audio.src = findMediaFile("audio", "content/test"); |
+ audio.onplaying = t.step_func(function() { |
+ runAfterHideMediaControlsTimerFired(t.step_func_done(controlsTimerFired), audio); |
+ }); |
- if (window.testRunner) { |
- testRunner.waitUntilDone(); |
- testRunner.dumpAsText(); |
+ function controlsTimerFired() { |
+ var controls = mediaControlsButton(audio, "panel"); |
+ assert_equals(getComputedStyle(controls).opacity, "1"); |
} |
- |
- var audio = document.getElementById("audio"); |
- audio.addEventListener("playing", function() |
- { |
- runAfterHideMediaControlsTimerFired(function() |
- { |
- controls = mediaControlsButton(audio, "panel"); |
- testExpected("getComputedStyle(controls).opacity", 1); |
- |
- consoleWrite(""); |
- endTest(); |
- }, audio); |
- }); |
-</script> |
-</body> |
+}); |
+</script> |