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

Unified Diff: LayoutTests/media/video-buffered-unknown-duration.html

Issue 499513002: Add layout test and test media for infinite duration tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Comments. Created 6 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 side-by-side diff with in-line comments
Download patch
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..76cf0a8f394121721fb593ceeec6acf6e722a6e0
--- /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 &lt; video.buffered.end(0) upon first timeupdate.</p>
+<video></video>
+<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, '<');
+ 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';
+ }
+</script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/media/resources/test-live.webm ('k') | LayoutTests/media/video-buffered-unknown-duration-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698