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

Unified Diff: third_party/WebKit/LayoutTests/media/audio-constructor-preload.html

Issue 1997263002: Convert audio-constructor* tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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-constructor-preload.html
diff --git a/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html b/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
index 3f02b27825819bab5d5a67af0a020c73319cff6f..ae635c7d440f7f51372924a0388bfbf0a5e4b471 100644
--- a/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
+++ b/third_party/WebKit/LayoutTests/media/audio-constructor-preload.html
@@ -1,41 +1,22 @@
-<html>
- <head>
- <script src=media-file.js></script>
- <!-- TODO(philipj): Convert test to testharness.js. crbug.com/588956
- (Please avoid writing new tests using video-test.js) -->
- <script src=video-test.js></script>
-
- <script>
-
- function canplaythrough()
- {
- consoleWrite("++ Test after 'canplaythrough' event");
- testExpected("mediaElement.getAttribute('preload')", "auto");
- testExpected("mediaElement.preload", "auto");
- endTest();
- }
-
- function start()
- {
- run("mediaElement = new Audio()");
- consoleWrite("");
-
- consoleWrite("++ Test initial attribute value");
- testExpected("mediaElement.getAttribute('preload')", "auto");
- testExpected("mediaElement.preload", "auto");
- consoleWrite("");
-
- mediaElement.addEventListener("canplaythrough", canplaythrough);
- run("mediaElement.src = '" + findMediaFile("audio", "content/test") + "'");
- run("mediaElement.load()");
-
- consoleWrite("");
- }
-
- </script>
- </head>
-
- <body onload="start()">
- <p>Test that Audio() sets 'preload' attribute.</p>
- </body>
-</html>
+<!DOCTYPE html>
+<title>Test that Audio() sets "preload" attribute.</title>
+<script src="media-file.js"></script>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+async_test(function(t) {
+ var audio = new Audio();
+
+ // Test initial attribute value.
+ assert_equals(audio.getAttribute("preload"), "auto");
+ assert_equals(audio.preload, "auto");
+
+ audio.oncanplaythrough = t.step_func_done(function() {
+ assert_equals(audio.getAttribute("preload"), "auto");
+ assert_equals(audio.preload, "auto");
+ });
+
+ audio.src = findMediaFile("audio", "content/test");
+ audio.load();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698