OLD | NEW |
(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 mediasource_test(function(test, mediaElement, mediaSource) |
| 13 { |
| 14 var mimetype = MediaSourceUtil.AUDIO_ONLY_TYPE; |
| 15 var subType = MediaSourceUtil.getSubType(mimetype); |
| 16 |
| 17 MediaSourceUtil.fetchManifestAndData(test, subType + '/test-a-192k
-44100Hz-1ch-manifest.json', function(type, mediaData) |
| 18 { |
| 19 var sourceBuffer = mediaSource.addSourceBuffer(mimetype); |
| 20 sourceBuffer.mode = 'sequence'; |
| 21 |
| 22 function onUpdateEnd() { |
| 23 // We are appending data repeatedly in sequence mode, ther
e should be no gaps. |
| 24 assert_false(sourceBuffer.buffered.length > 1, "unexpected
gap in buffered ranges."); |
| 25 try { |
| 26 sourceBuffer.appendBuffer(mediaData); |
| 27 } catch(ex) { |
| 28 assert_equals(ex.name, 'QuotaExceededError'); |
| 29 test.done(); |
| 30 } |
| 31 test.expectEvent(sourceBuffer, 'updateend', 'append ended.
'); |
| 32 test.waitForExpectedEvents(onUpdateEnd); |
| 33 } |
| 34 // Start appending data |
| 35 onUpdateEnd(); |
| 36 }); |
| 37 }, 'Appending data repeatedly should fill up the buffer and throw a Qu
otaExceededError when buffer is full.', {timeout: 25000}); |
| 38 </script> |
| 39 </body> |
| 40 </html> |
OLD | NEW |