| Index: third_party/WebKit/LayoutTests/media/video-play-empty-events.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
|
| index 6f08f9bbe2e1c8c8d868ddedcc3c558facdc1658..f761aa781db5ab815dff6ffa62a15496e72f9bd0 100644
|
| --- a/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
|
| +++ b/third_party/WebKit/LayoutTests/media/video-play-empty-events.html
|
| @@ -1,31 +1,28 @@
|
| -<html>
|
| -<body>
|
| +<!DOCTYPE html>
|
| +<title>Test that play() from EMPTY network state triggers load() and async playing event.</title>
|
| +<script src="../resources/testharness.js"></script>
|
| +<script src="../resources/testharnessreport.js"></script>
|
| +<script src="media-file.js"></script>
|
| +<video></video>
|
| +<script>
|
| +async_test(function(t) {
|
| + var video = document.querySelector("video");
|
| + assert_equals(video.networkState, HTMLMediaElement.NETWORK_EMPTY);
|
|
|
| - <video controls></video>
|
| - <p>Test that play() from EMPTY network state triggers load() and async play event.</p>
|
| - <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>
|
| - testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
|
| + video.onloadstart = t.step_func(function() {});
|
| + video.onratechange = t.step_func(function() {});
|
| + video.onwaiting = t.step_func(function() {});
|
| + video.ondurationchange = t.step_func(function() {});
|
| + video.onloadedmetadata = t.step_func(function() {});
|
| + video.onloadeddata = t.step_func(function() {});
|
| + video.oncanplay = t.step_func(function() {});
|
| + video.onplay = t.step_func(function() {});
|
|
|
| - waitForEvent("loadstart");
|
| - waitForEvent("ratechange");
|
| - waitForEvent("waiting");
|
| - waitForEvent("ratechange");
|
| - waitForEvent("durationchange");
|
| - waitForEvent("loadedmetadata");
|
| - waitForEvent("loadeddata");
|
| - waitForEvent("canplay");
|
| - waitForEvent("play");
|
| + video.onplaying = t.step_func_done(function () {
|
| + assert_false(video.paused);
|
| + });
|
|
|
| - waitForEvent('playing', function () { testExpected("video.paused", false); endTest(); } );
|
| -
|
| - video.src = findMediaFile("video", "content/test");
|
| - run("video.play()");
|
| - consoleWrite("SCRIPT DONE");
|
| - </script>
|
| -
|
| -</body>
|
| -</html>
|
| + video.src = findMediaFile("video", "content/test");
|
| + video.play();
|
| +});
|
| +</script>
|
|
|