Index: LayoutTests/media/video-buffered-unknown-duration.html |
diff --git a/LayoutTests/media/video-buffered-unknown-duration.html b/LayoutTests/media/video-buffered-unknown-duration.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..edb38bc13ef373b0d81123d9e22326fb1f708854 |
--- /dev/null |
+++ b/LayoutTests/media/video-buffered-unknown-duration.html |
@@ -0,0 +1,38 @@ |
+<!DOCTYPE html> |
+<html> |
+<body onload="start()"> |
+<p>Load a video with an infinite duration. Start playback and ensure |
+video.currentTime < video.buffered.end(0) upon first timeupdate.</p> |
+<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.
|
+<script src="video-test.js"></script> |
+<script src="media-file.js"></script> |
+<script> |
+ waitForEventOnce('timeupdate', function() { |
+ video.pause(); |
+ |
+ testExpected('video.duration', Infinity, '=='); |
+ testExpected('video.buffered.start(0)', 0, '>='); |
+ |
+ // 10 seconds chosen arbitrarily as it's larger than the duration, but |
+ // small enough to test for overflow of arithmetic performed on the |
+ // infinite duration. |
+ 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
|
+ test('video.currentTime <= video.buffered.end(0)'); |
+ endTest(); |
+ }); |
+ |
+ waitForEventOnce('loadeddata', function() { |
+ testExpected('video.buffered.length', 1, '=='); |
+ testExpected('video.buffered.start(0)', 0, '>='); |
+ testExpected('video.buffered.end(0)', Infinity, '!='); |
+ testExpected('video.currentTime', 0, '=='); |
+ testExpected('video.duration', Infinity, '=='); |
+ video.play(); |
+ }); |
+ |
+ function start() { |
+ 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
|
+ } |
+</script> |
+</body> |
+</html> |