Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html |
| diff --git a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html |
| index 2d0fa8cefe65ffc9aa0309622a49e6a8acebe3b2..894bb857edb7e306c2235912807a39645d174fd4 100644 |
| --- a/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html |
| +++ b/third_party/WebKit/LayoutTests/media/video-no-timeupdate-before-playback.html |
| @@ -1,25 +1,25 @@ |
| <!DOCTYPE html> |
| -<html> |
| -<body> |
| - <p>Test that no timeupdate event fires during loading.</p> |
| - <video></video> |
| - <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> |
| - waitForEvent("loadstart"); |
| - waitForEvent("loadedmetadata"); |
| - waitForEvent("loadeddata"); |
| - waitForEvent("canplay"); |
| - waitForEvent("canplaythrough", function() |
| - { |
| - // Let pending async events fire before ending the test. |
| - window.setTimeout(function() { endTest(); }, 0); |
| - }); |
| - waitForEventAndFail("timeupdate"); |
| +<title>Test that no timeupdate event fires during loading.</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.onloadstart = t.step_func(function() {}); |
| + video.onloadedmetadata = t.step_func(function() {}); |
| + video.onloadeddata = t.step_func(function() {}); |
| + video.oncanplay = t.step_func(function() {}); |
| - video.src = findMediaFile("video", "content/test"); |
| - </script> |
| -</body> |
| -</html> |
| + video.oncanplaythrough = t.step_func(function() { |
| + // Let pending async events fire before ending the test. |
| + setTimeout(function() { |
|
fs
2016/06/22 10:47:18
Nit: Use step_func_done?
Srirama
2016/06/22 11:15:58
Done.
|
| + t.done(); |
| + }, 0); |
| + }); |
| + |
| + video.ontimeupdate = t.unreached_func(); |
| + video.src = findMediaFile("video", "content/test"); |
| +}); |
| +</script> |