Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / media / media-source / mediasource-play.html
blob2a6ede3a3532b608dbfcdc82bcb5b3390bb52944
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 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");
31 });
33 test.waitForExpectedEvents(function()
35 mediaSource.endOfStream();
36 mediaElement.play();
38 test.endOnEvent(mediaElement, 'ended');
39 });
41 }, "Test normal playback case with MediaSource API", {timeout: 5000});
42 </script>
43 </body>
44 </html>