| Index: third_party/WebKit/LayoutTests/media/audio-play-event.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/audio-play-event.html b/third_party/WebKit/LayoutTests/media/audio-play-event.html
|
| index d20c9086c498ab8d35d89665820c949664477e05..906651cfb9e5e0335a4a617bf03cc1e55984cbc9 100644
|
| --- a/third_party/WebKit/LayoutTests/media/audio-play-event.html
|
| +++ b/third_party/WebKit/LayoutTests/media/audio-play-event.html
|
| @@ -1,28 +1,17 @@
|
| -<html>
|
| - <head>
|
| - <title>'play' event</title>
|
| - <script src=media-file.js></script>
|
| - <!-- 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>
|
| -
|
| - <script>
|
| - function start()
|
| - {
|
| - mediaElement = new Audio();
|
| - waitForEvent('error');
|
| - waitForEvent('loadedmetadata');
|
| - waitForEvent('canplay');
|
| - waitForEvent('play');
|
| - waitForEvent('playing', function() { endTest(); });
|
| - run("mediaElement.src = findMediaFile('audio', 'content/test')");
|
| - run("mediaElement.volume = 1");
|
| - run("mediaElement.play()");
|
| - }
|
| - </script>
|
| - </head>
|
| -
|
| - <body onload="start()">
|
| - <p>Test that a 'play' event listener is triggered when fired by a new audio element.</p>
|
| - </body>
|
| -</html>
|
| +<!DOCTYPE HTML>
|
| +<title>Test that a 'play' event is fired by a new audio element on playing.</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();
|
| + audio.onplay = t.step_func(function() {});
|
| + audio.onloadedmetadata = t.step_func(function() {});
|
| + audio.oncanplay = t.step_func(function() {});
|
| + audio.onplaying = t.step_func_done();
|
| + audio.onerror = t.unreached_func("Should not fire 'error' event");
|
| + audio.src = findMediaFile("audio", "content/test");
|
| + audio.play();
|
| +});
|
| +</script>
|
|
|