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..3f0b2c541100e2b9cbe1ee920b8da5b5baf6130d 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,23 @@ |
<!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(t.step_func_done(), 0); |
+ }); |
+ |
+ video.ontimeupdate = t.unreached_func(); |
+ video.src = findMediaFile("video", "content/test"); |
+}); |
+</script> |