Index: third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html |
index ff27dedd699d415a2c51f60fe4c977ead5e4d54d..cefe7535149af46e95cb1c3d8d453517cbaf5efb 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered-range-contains-currentTime.html |
@@ -1,33 +1,24 @@ |
-<html> |
- <head> |
- <script src=../../media-resources/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=../../media-resources/video-test.js></script> |
- <script> |
- if (window.testRunner) |
- testRunner.dumpAsTextWithPixelResults(); // To get pixels. |
+<!DOCTYPE html> |
+<title>Test that the painted buffered range contains currentTime.</title> |
+<script src="../../media-resources/media-file.js"></script> |
+<video controls></video> |
+<script> |
+var video = document.querySelector("video"); |
- function start() { |
- findMediaElement(); |
+testRunner.waitUntilDone(); |
+video.onended = function() { |
+ testRunner.notifyDone(); |
+}; |
- waitForEventAndEnd('ended'); |
- waitForEvent('seeked', function() { |
- video.play(); |
- }); |
- waitForEvent('loadedmetadata', function() { |
- video.currentTime = video.duration - 0.5; |
- } ); |
+video.onseeked = function() { |
+ video.play(); |
+}; |
- var mediaFile = findMediaFile("audio", "../../../media/content/test"); |
- var type = mimeTypeForExtension(mediaFile.split('.').pop()); |
- video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=50&nph=1&type=" + type; |
- video.load(); |
- } |
- </script> |
- </head> |
- <body onload="start()"> |
- <video controls></video> |
- <p>Test that the painted buffered range contains currentTime.</p> |
- </body> |
-</html> |
+video.onloadedmetadata = function() { |
+ video.currentTime = video.duration - 0.5; |
+}; |
+ |
+var mediaFile = findMediaFile("audio", "../../../media/content/test"); |
+var type = mimeTypeForExtension(mediaFile.split(".").pop()); |
+video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?name=" + mediaFile + "&throttle=5000&nph=1&type=" + type; |
+</script> |