| Index: third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
|
| diff --git a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
|
| index 9d3c0691499d94b09e5d27bd357cd961b757639c..b5a3e4cf9fbe87c763c0078f9a59686d9215b8c9 100644
|
| --- a/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
|
| +++ b/third_party/WebKit/LayoutTests/media/video-timeupdate-during-playback.html
|
| @@ -1,58 +1,25 @@
|
| -<html>
|
| -<body>
|
| -
|
| - <video controls></video>
|
| -
|
| - <p>
|
| - Test 'timeupdate' events are posted while playing but not while paused.
|
| - </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>
|
| - setSrcByTagName("video", findMediaFile("video", "content/test"));
|
| -
|
| - var timeupdateEventCount = 0;
|
| - var countWhilePlaying = 0;
|
| -
|
| - function someTimeLater()
|
| - {
|
| - if (countWhilePlaying != timeupdateEventCount)
|
| - failTest("'timeupdate' events posted after pausing");
|
| - endTest();
|
| - }
|
| -
|
| - function pause()
|
| - {
|
| - countWhilePlaying = timeupdateEventCount;
|
| - setTimeout(someTimeLater, 400) ;
|
| - consoleWrite("");
|
| - }
|
| -
|
| - function playing()
|
| - {
|
| - setTimeout(function () { run("video.pause()"); }, 500) ;
|
| - consoleWrite("");
|
| - }
|
| -
|
| - mediaElement.addEventListener("timeupdate", function () { ++timeupdateEventCount; });
|
| -
|
| - waitForEvent('error');
|
| - waitForEvent("loadstart");
|
| - waitForEvent("waiting");
|
| - waitForEvent("ratechange");
|
| - waitForEvent("durationchange");
|
| - waitForEvent("loadedmetadata");
|
| - waitForEvent("loadeddata");
|
| - waitForEvent("canplay");
|
| - waitForEvent("pause", pause);
|
| - waitForEvent("play");
|
| - waitForEvent("playing", playing);
|
| -
|
| - run("video.play()");
|
| - consoleWrite("");
|
| - </script>
|
| -
|
| -</body>
|
| -</html>
|
| +<!DOCTYPE html>
|
| +<title>Test "timeupdate" events are posted while playing but not while paused.</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");
|
| + video.src = findMediaFile("video", "content/test");
|
| +
|
| + video.onplaying = t.step_func(function() {
|
| + video.ontimeupdate = t.step_func(function() {
|
| + video.pause();
|
| + });
|
| + });
|
| +
|
| + video.onpause = t.step_func(function() {
|
| + video.ontimeupdate = t.unreached_func();
|
| + setTimeout(t.step_func_done(), 250);
|
| + });
|
| +
|
| + video.play();
|
| +});
|
| +</script>
|
|
|