CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
[WebKit-https.git] / LayoutTests / media / media-source / media-source-sample-wrong-track-id.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>media-source-sample-wrong-track-id</title>
5     <script src="mock-media-source.js"></script>
6     <script src="../video-test.js"></script>
7     <script>
8     var source;
9     var sourceBuffer;
10     var initSegment;
11     var mediaSegment;
12
13     if (window.internals)
14         internals.initializeMockMediaSource();
15
16     function runTest() {
17         findMediaElement();
18
19         source = new MediaSource();
20         waitForEventOn(source, 'sourceopen', sourceOpen, false, true);
21         run('video.src = URL.createObjectURL(source)');
22     }
23
24     function sourceOpen() {
25         run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")');
26         waitForEventOn(sourceBuffer, 'updateend', endTest);
27         consoleWrite('Append a set of invalid, overlapping samples. Should not crash.')
28         mediaSegment = concatenateSamples([
29             makeAInit(2, [makeATrack(1, 'mock', TRACK_KIND.AUDIO)]), 
30             makeASample(1, 1, 1, 2, SAMPLE_FLAG.SYNC, 0),
31             makeASample(1, 0, 2, 2, SAMPLE_FLAG.SYNC, 0),
32         ]);
33         run('sourceBuffer.appendBuffer(mediaSegment)');
34     }
35     </script>
36 </head>
37 <body onload="runTest()">
38     <video></video>
39 </body>
40 </html>