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'
>
12 mediasource_testafterdataloaded(function(test
, mediaElement
, mediaSource
, segmentInfo
, sourceBuffer
, mediaData
)
14 test
.failOnEvent(mediaElement
, 'error');
16 assert_false(sourceBuffer
.updating
, "sourceBuffer.updating");
18 sourceBuffer
.appendBuffer(mediaData
);
20 assert_true(sourceBuffer
.updating
, "sourceBuffer.updating");
21 test
.expectEvent(sourceBuffer
, "updateend");
23 test
.waitForExpectedEvents(function()
25 assert_false(sourceBuffer
.updating
, "sourceBuffer.updating");
27 mediaSource
.duration
= 1;
29 assert_true(sourceBuffer
.updating
, "sourceBuffer.updating");
30 test
.expectEvent(sourceBuffer
, "updateend");
33 test
.waitForExpectedEvents(function()
35 mediaSource
.endOfStream();
38 test
.endOnEvent(mediaElement
, 'ended');
41 }, "Test normal playback case with MediaSource API", {timeout
: 5000});