Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/media/video-buffered.html

Issue 2196673002: Convert video-buffer* http tests to testharness.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <!DOCTYPE html>
2 <head> 2 <title>Check buffered timeranges with video preload.</title>
3 </head> 3 <script src="../resources/testharness.js"></script>
4 <body onload="start()"> 4 <script src="../resources/testharnessreport.js"></script>
5 <p>Start playing a video with preloading enabled, do a seek near the 5 <script src="../../media-resources/media-file.js"></script>
6 end and check multiple buffered timeranges have been created.</p> 6 <video preload="auto"></video>
7 <video id="video" preload="auto" autobuffer></video>
8 <!-- TODO(foolip): Convert test to testharness.js. crbug.com/588956
9 (Please avoid writing new tests using video-test.js) -->
10 <script src=../../media-resources/video-test.js></script>
11 <script src=../../media-resources/media-file.js></script>
12 <script> 7 <script>
13 waitForEvent("ended", ended); 8 async_test(function(t) {
14 waitForEventOnce('playing', function() { 9 var video = document.querySelector("video");
15 testExpected("video.buffered.length", 1, "=="); 10
16 run("video.currentTime = video.duration - 0.5"); 11 video.onended = t.step_func_done(function() {
12 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
17 }); 13 });
18 14
19 function ended() { 15 video.onplaying = t.step_func(function() {
20 testExpected("video.buffered.length", 2, "=="); 16 video.onplaying = null;
21 endTest(); 17 video.currentTime = video.duration - 0.5;
22 } 18 });
23 19
24 function start () { 20 var mediaFile = findMediaFile("video", "../../../media/content/counting");
25 video = document.getElementById('video'); 21 var type = mimeTypeForExtension(mediaFile.split(".").pop());
26 var mediaFile = findMediaFile("audio", "../../../media/content/test"); 22 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1&name =" + mediaFile + "&throttle=100&type=" + type;
27 var type = mimeTypeForExtension(mediaFile.split('.').pop()); 23 video.play();
28 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1& name=" + mediaFile + "&throttle=100&type=" + type; 24 });
29 25 </script>
30 video.play();
31 }
32 </script>
33 </body>
34 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698