mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Copyright © 2016 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="timeout" content="long">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="mediasource-util.js"></script>
|
||||
<script>
|
||||
var subType = MediaSourceUtil.getSubType(MediaSourceUtil.AUDIO_ONLY_TYPE);
|
||||
var manifestFilenameAudio = subType + "/test-a-128k-44100Hz-1ch-manifest.json";
|
||||
|
||||
// Fill up a given SourceBuffer by appending data repeatedly via doAppendDataFunc until
|
||||
// an exception is thrown. The thrown exception is passed to onCaughtExceptionCallback.
|
||||
function fillUpSourceBuffer(test, sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback) {
|
||||
// We are appending data repeatedly in sequence mode, there should be no gaps.
|
||||
assert_false(sourceBuffer.buffered.length > 1, "unexpected gap in buffered ranges.");
|
||||
try {
|
||||
doAppendDataFunc();
|
||||
} catch(ex) {
|
||||
onCaughtExceptionCallback(ex);
|
||||
}
|
||||
test.expectEvent(sourceBuffer, 'updateend', 'append ended.');
|
||||
test.waitForExpectedEvents(function() { fillUpSourceBuffer(test, sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback); });
|
||||
}
|
||||
|
||||
mediasource_test(function(test, mediaElement, mediaSource)
|
||||
{
|
||||
mediaElement.addEventListener("error", test.unreached_func("Unexpected event 'error'"));
|
||||
MediaSourceUtil.fetchManifestAndData(test, manifestFilenameAudio, function(typeAudio, dataAudio)
|
||||
{
|
||||
var sourceBuffer = mediaSource.addSourceBuffer(typeAudio);
|
||||
sourceBuffer.mode = 'sequence';
|
||||
fillUpSourceBuffer(test, sourceBuffer,
|
||||
function () { // doAppendDataFunc
|
||||
sourceBuffer.appendBuffer(dataAudio);
|
||||
},
|
||||
function (ex) { // onCaughtExceptionCallback
|
||||
assert_equals(ex.name, 'QuotaExceededError');
|
||||
test.done();
|
||||
});
|
||||
});
|
||||
}, 'Appending data repeatedly should fill up the buffer and throw a QuotaExceededError when buffer is full.');
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue