Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/w3c/resources/testharness.js"></script> | 4 <script src="/w3c/resources/testharness.js"></script> |
| 5 <script src="/w3c/resources/testharnessreport.js"></script> | 5 <script src="/w3c/resources/testharnessreport.js"></script> |
| 6 <script src="mediasource-util.js"></script> | 6 <script src="../mediasource-util.js"></script> |
| 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> | 7 <link rel='stylesheet' href='/w3c/resources/testharness.css'> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <div id="log"></div> | 10 <div id="log"></div> |
| 11 <script> | 11 <script> |
| 12 // Fill up a given SourceBuffer by appending data repeatedly via doApp endDataFunc until | 12 // Fill up a given SourceBuffer by appending data repeatedly via doApp endDataFunc until |
| 13 // an exception is thrown. The thrown exception is passed to onCaughtE xceptionCallback. | 13 // an exception is thrown. The thrown exception is passed to onCaughtE xceptionCallback. |
| 14 function fillUpSourceBuffer(test, sourceBuffer, doAppendDataFunc, onCa ughtExceptionCallback) { | 14 function fillUpSourceBuffer(test, sourceBuffer, doAppendDataFunc, onCa ughtExceptionCallback) { |
| 15 // We are appending data repeatedly in sequence mode, there should be no gaps. | 15 // We are appending data repeatedly in sequence mode, there should be no gaps. |
| 16 assert_false(sourceBuffer.buffered.length > 1, "unexpected gap in buffered ranges."); | 16 assert_false(sourceBuffer.buffered.length > 1, "unexpected gap in buffered ranges."); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 28 MediaSourceUtil.fetchManifestAndData(test, 'webm/test-a-5min-44100 Hz-1ch-manifest.json', function(type, mediaData) | 28 MediaSourceUtil.fetchManifestAndData(test, 'webm/test-a-5min-44100 Hz-1ch-manifest.json', function(type, mediaData) |
| 29 { | 29 { |
| 30 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil .AUDIO_ONLY_TYPE); | 30 var sourceBuffer = mediaSource.addSourceBuffer(MediaSourceUtil .AUDIO_ONLY_TYPE); |
| 31 sourceBuffer.mode = 'sequence'; | 31 sourceBuffer.mode = 'sequence'; |
| 32 | 32 |
| 33 fillUpSourceBuffer(test, sourceBuffer, | 33 fillUpSourceBuffer(test, sourceBuffer, |
| 34 function () { // doAppendDataFunc | 34 function () { // doAppendDataFunc |
| 35 sourceBuffer.appendBuffer(mediaData); | 35 sourceBuffer.appendBuffer(mediaData); |
| 36 }, | 36 }, |
| 37 function (ex) { // onCaughtExceptionCallback | 37 function (ex) { // onCaughtExceptionCallback |
| 38 assert_equals(ex.name, 'QuotaExceededError'); | 38 assert_equals(ex.name, 'QuotaExceededError'); |
|
wolenetz
2016/08/01 20:21:25
I wonder if we should verify that the attempted ap
| |
| 39 test.done(); | 39 test.done(); |
| 40 }); | 40 }); |
| 41 }); | 41 }); |
| 42 }, 'Appending data repeatedly should fill up the buffer and throw a Qu otaExceededError when buffer is full.'); | 42 }, 'Appending data repeatedly should fill up the buffer and throw a Qu otaExceededError when buffer is full.'); |
| 43 </script> | 43 </script> |
| 44 </body> | 44 </body> |
| 45 </html> | 45 </html> |
| OLD | NEW |