mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset e82170d665d8 (bug 1087944)
This commit is contained in:
parent
165f8e61c9
commit
96b12573a9
@ -10,17 +10,6 @@
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
var renderedBuffer = null;
|
||||
|
||||
function setOrCompareRenderedBuffer(aRenderedBuffer) {
|
||||
if (renderedBuffer) {
|
||||
is(renderedBuffer, aRenderedBuffer, "Rendered buffers from the event and the promise should be the same");
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
renderedBuffer = aRenderedBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(function() {
|
||||
var ctx = new OfflineAudioContext(2, 100, 22050);
|
||||
@ -58,31 +47,18 @@ addLoadEvent(function() {
|
||||
src.buffer = buf;
|
||||
src.start(0);
|
||||
src.connect(ctx.destination);
|
||||
|
||||
ctx.startRendering();
|
||||
ctx.addEventListener("complete", function(e) {
|
||||
ok(e instanceof OfflineAudioCompletionEvent, "Correct event received");
|
||||
is(e.renderedBuffer.numberOfChannels, 2, "Correct expected number of buffers");
|
||||
ok(renderedBuffer != null, "The event should be fired after the promise callback.");
|
||||
expectNoException(function() {
|
||||
ctx.startRendering().then(function() {
|
||||
ok(false, "Promise should not resolve when startRendering is called a second time on an OfflineAudioContext")
|
||||
}).catch(function(err) {
|
||||
ok(true, "Promise should reject when startRendering is called a second time on an OfflineAudioContext")
|
||||
});
|
||||
});
|
||||
compareBuffers(e.renderedBuffer, buf);
|
||||
setOrCompareRenderedBuffer(e.renderedBuffer);
|
||||
|
||||
expectException(function() {
|
||||
ctx.startRendering();
|
||||
}, DOMException.INVALID_STATE_ERR);
|
||||
|
||||
SimpleTest.finish();
|
||||
}, false);
|
||||
|
||||
expectNoException(function() {
|
||||
ctx.startRendering().then(function(b) {
|
||||
is(renderedBuffer, null, "The promise callback should be called first.");
|
||||
setOrCompareRenderedBuffer(b);
|
||||
}).catch(function (error) {
|
||||
ok(false, "The promise from OfflineAudioContext.startRendering should never be rejected");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user