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

Side by Side 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 unified diff | Download patch
OLDNEW
(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 &lt; video.buffered.end(0) upon first timeupdate.</p>
6 <video></video>
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, '<');
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';
35 }
36 </script>
37 </body>
38 </html>
OLDNEW
« 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