Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html |
| index d9903eb7d0dbb6115dd7818ced91c76bf3a5ce06..7a0a478d4270186cdd0f1b30e4e88bbc4aa58dda 100644 |
| --- a/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html |
| +++ b/third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html |
| @@ -1,34 +1,25 @@ |
| -<html> |
| -<head> |
| -</head> |
| -<body onload="start()"> |
| -<p>Start playing a video with preloading enabled, do a seek near the |
| - end and check multiple buffered timeranges have been created.</p> |
| -<video id="video" preload="auto" autobuffer></video> |
| -<!-- 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 src=../../media-resources/media-file.js></script> |
| +<!DOCTYPE html> |
| +<title>Check buffered timeranges with video preload.</title> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<script src="../../media-resources/media-file.js"></script> |
| +<video preload="auto"></video> |
| <script> |
| - waitForEvent("ended", ended); |
| - waitForEventOnce('playing', function() { |
| - testExpected("video.buffered.length", 1, "=="); |
| - run("video.currentTime = video.duration - 0.5"); |
| - }); |
| +async_test(function(t) { |
| + var video = document.querySelector("video"); |
| - function ended() { |
| - testExpected("video.buffered.length", 2, "=="); |
| - endTest(); |
| - } |
| + video.onended = t.step_func_done(function() { |
| + assert_equals(video.buffered.length, 1); |
|
fs
2016/08/11 16:53:20
Please expand on the changes done to this test (1
Srirama
2016/08/11 18:17:38
Changed it because the buffered length is always 1
fs
2016/08/11 20:41:03
To be on the safe side, it's probably better to le
Srirama
2016/08/12 14:17:48
Looking at the history (https://codereview.chromiu
|
| + }); |
| - function start () { |
| - video = document.getElementById('video'); |
| - 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?nph=1&name=" + mediaFile + "&throttle=100&type=" + type; |
| + video.onplaying = t.step_func(function() { |
| + video.onplaying = null; |
| + video.currentTime = video.duration - 0.5; |
| + }); |
| - video.play(); |
| - } |
| -</script> |
| -</body> |
| -</html> |
| + var mediaFile = findMediaFile("video", "../../../media/content/counting"); |
| + var type = mimeTypeForExtension(mediaFile.split(".").pop()); |
| + video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1&name=" + mediaFile + "&throttle=100&type=" + type; |
| + video.play(); |
| +}); |
| +</script> |