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

Side by Side Diff: LayoutTests/http/tests/media/media-source/mediasource-seekable.html

Issue 710173004: Implement seekable() according to the MediaSource specification (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix some small review nits Created 6 years, 1 month 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-seekable-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="/w3c/resources/testharness.js"></script>
5 <script src="/w3c/resources/testharnessreport.js"></script>
6 <script src="mediasource-util.js"></script>
7 <link rel="stylesheet" href="/w3c/resources/testharness.css">
8 </head>
9 <body>
10 <div id="log"></div>
11 <script>
12
13 mediasource_test(function(test, mediaElement, mediaSource)
14 {
15 test.failOnEvent(mediaElement, 'error');
16 test.endOnEvent(mediaElement, 'ended');
17
18 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil.A UDIO_ONLY_TYPE);
19
20 assertSeekableEquals(mediaElement, '{ }', 'mediaElement.seekable ');
21 test.done();
22 }, 'Get seekable time ranges when the sourcebuffer is empty.');
23
24 mediasource_testafterdataloaded(function(test, mediaElement, mediaSo urce, segmentInfo, sourceBuffer, mediaData)
25 {
26 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
27 test.expectEvent(mediaElement, 'durationchange', 'mediaElement g ot duration');
28 sourceBuffer.appendBuffer(initSegment);
29 test.waitForExpectedEvents(function()
30 {
31 assert_equals(mediaElement.duration, 6.042);
32 assertSeekableEquals(mediaElement, '{ [0.000, 6.042) }', 'me diaElement.seekable');
33 test.done();
34 });
35 }, 'Get seekable time ranges after init segment received.');
36
37 mediasource_testafterdataloaded(function(test, mediaElement, mediaSo urce, segmentInfo, sourceBuffer, mediaData)
38 {
39 var initSegment = MediaSourceUtil.extractSegmentData(mediaData, segmentInfo.init);
40 test.expectEvent(mediaElement, 'durationchange', 'mediaElement g ot duration after initsegment');
41 sourceBuffer.appendBuffer(initSegment);
42 test.waitForExpectedEvents(function()
43 {
44 test.expectEvent(mediaElement, 'durationchange', 'mediaEleme nt got infinity duration');
45 mediaSource.duration = Infinity;
46 test.waitForExpectedEvents(function()
47 {
48 assertSeekableEquals(mediaElement, '{ }', 'mediaElement. seekable');
49
50 // Append a segment from the middle of the stream to mak e sure that seekable does not use buffered.start(0) or duration as first or last value
51 var midSegment = MediaSourceUtil.extractSegmentData(medi aData, segmentInfo.media[2]);
52 test.expectEvent(sourceBuffer, 'update');
53 test.expectEvent(sourceBuffer, 'updateend');
54 sourceBuffer.appendBuffer(midSegment);
55 test.waitForExpectedEvents(function()
56 {
57 assert_equals(mediaElement.seekable.length, 1, 'medi aElement.seekable.length');
58 assert_equals(mediaElement.buffered.length, 1, 'medi aElement.buffered.length');
59 assert_equals(mediaElement.seekable.start(0), 0);
60 assert_not_equals(mediaElement.seekable.end(0), medi aElement.duration);
61 assert_not_equals(0, mediaElement.buffered.start(0)) ;
62 assert_equals(mediaElement.seekable.end(0), mediaEle ment.buffered.end(0));
63 test.done();
64 });
65 });
66 });
67 }, 'Get seekable time ranges on an infinite stream.');
68 </script>
69 </body>
70 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/media/media-source/mediasource-seekable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698