Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: third_party/WebKit/LayoutTests/media/audio-controls-do-not-fade-out.html

Issue 2004963003: Convert audio-controls* and audio-delete* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698