Chromium Code Reviews| 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..e6ba1339c4b4b629c12d3e5656f649c600afcae9 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,28 @@ |
| -<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="../resources/testharness.js"></script> |
|
fs
2016/08/11 16:53:20
Not really using this?
Srirama
2016/08/11 18:17:38
Yes, not using. I have experimented so much and fi
|
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="../../media-resources/media-file.js"></script> |
| +<body> |
| +<video controls></video> |
| +<script> |
| +var video = document.querySelector("video"); |
| - function start() { |
| - findMediaElement(); |
| +testRunner.dumpAsTextWithPixelResults(); |
| +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=50&nph=1&type=" + type; |
| +</script> |