Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / media / video-buffered.html
blobc025367a45f1849b6860fe9d89e4d4e4a7f966ef
1 <html>
2 <head>
3 </head>
4 <body onload="start()">
5 <p>Start playing a video with preloading enabled, do a seek near the
6 end and check multiple buffered timeranges have been created.</p>
7 <video id="video" preload="auto" autobuffer></video>
8 <script src=../../media-resources/video-test.js></script>
9 <script src=../../media-resources/media-file.js></script>
10 <script>
11 waitForEvent("ended", ended);
12 waitForEventOnce('playing', function() {
13 testExpected("video.buffered.length", 1, "==");
14 run("video.currentTime = video.duration - 0.5");
15 });
17 function ended() {
18 testExpected("video.buffered.length", 2, "==");
19 endTest();
22 function start () {
23 video = document.getElementById('video');
24 var mediaFile = findMediaFile("audio", "../../../media/content/test");
25 var type = mimeTypeForExtension(mediaFile.split('.').pop());
26 video.src = "http://127.0.0.1:8000/media/video-throttled-load.cgi?nph=1&name=" + mediaFile + "&throttle=100&type=" + type;
28 video.play();
30 </script>
31 </body>
32 </html>