5ea2374a08698764fbdc89b1289cabae37978db8
[WebKit-https.git] / LayoutTests / media / media-source / media-source-append-failed.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>mock-media-source</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
12     if (window.internals)
13         internals.initializeMockMediaSource();
14
15     function runTest() {
16         findMediaElement();
17
18         source = new MediaSource();
19         waitForEventOn(source, 'sourceopen', sourceOpen);
20         run('video.src = URL.createObjectURL(source)');
21     }
22
23     function sourceOpen() {
24         run('sourceBuffer = source.addSourceBuffer("video/mock; codecs=mock")');
25
26         waitForEventOn(sourceBuffer, 'updatestart');
27         waitForEventOn(sourceBuffer, 'update');
28         waitForEventOn(sourceBuffer, 'updateend');
29         waitForEventOn(source, 'sourceended', endTest);
30         initSegment = makeAnInvalidBox();
31         run('sourceBuffer.appendBuffer(initSegment)');
32     }
33     
34     </script>
35 </head>
36 <body onload="runTest()">
37     <video></video>
38 </body>
39 </html>