OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <body onload="start()"> | |
4 <p>Load a video with an infinite duration. Start playback and ensure | |
5 video.currentTime < video.buffered.end(0) upon first timeupdate.</p> | |
6 <video preload></video> | |
scherkus (not reviewing)
2014/08/22 02:38:41
nit: drop preload attribute altogether (absence is
DaleCurtis
2014/08/22 19:40:29
Done.
| |
7 <script src="video-test.js"></script> | |
8 <script src="media-file.js"></script> | |
9 <script> | |
10 waitForEventOnce('timeupdate', function() { | |
11 video.pause(); | |
12 | |
13 testExpected('video.duration', Infinity, '=='); | |
14 testExpected('video.buffered.start(0)', 0, '>='); | |
15 | |
16 // 10 seconds chosen arbitrarily as it's larger than the duration, but | |
17 // small enough to test for overflow of arithmetic performed on the | |
18 // infinite duration. | |
19 testExpected('video.buffered.end(0)', 10, '<'); | |
scherkus (not reviewing)
2014/08/22 02:38:41
good test future proofing thing: add a testExpecte
DaleCurtis
2014/08/22 19:40:29
duration == infinite, so I can't actually check th
| |
20 test('video.currentTime <= video.buffered.end(0)'); | |
21 endTest(); | |
22 }); | |
23 | |
24 waitForEventOnce('loadeddata', function() { | |
25 testExpected('video.buffered.length', 1, '=='); | |
26 testExpected('video.buffered.start(0)', 0, '>='); | |
27 testExpected('video.buffered.end(0)', Infinity, '!='); | |
28 testExpected('video.currentTime', 0, '=='); | |
29 testExpected('video.duration', Infinity, '=='); | |
30 video.play(); | |
31 }); | |
32 | |
33 function start() { | |
34 video.src = 'resources/test-live.webm'; | |
scherkus (not reviewing)
2014/08/22 02:38:41
you should use findMediaFile() (check out other te
DaleCurtis
2014/08/22 19:40:29
findMediaFile won't work here since it doesn't und
| |
35 } | |
36 </script> | |
37 </body> | |
38 </html> | |
OLD | NEW |