| 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>
|
|
|