Bug 1530178 - Fix audiobuffer-copy-channel.html to allow copyFromChannel/copyToChannel wth an offset of n on an array that is n elements long. r=karlt

This is a no-op, but is allowed per spec:

> An optional offset to copy the data to. If startInChannel is greater than the
> length of the AudioBuffer, an IndexSizeError MUST be thrown.

If the numbers are equals, this shouldn't throw.

Differential Revision: https://phabricator.services.mozilla.com/D29358

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Paul Adenot 2019-05-02 09:24:57 +00:00
parent d934ec2ff8
commit a8fb83f275

View File

@ -143,7 +143,7 @@
buffer.copyFromChannel(x, 0, bufferLength);
},
'6: buffer.copyFromChannel(x, 0, ' + bufferLength + ')')
.throw(DOMException, 'IndexSizeError');
.notThrow();
should(() => {
buffer.copyFromChannel(x, 3);
@ -198,7 +198,7 @@
buffer.copyToChannel(x, 0, bufferLength);
},
'5: buffer.copyToChannel(x, 0, ' + bufferLength + ')')
.throw(DOMException, 'IndexSizeError');
.notThrow();
should(() => {
buffer.copyToChannel(x, 3);
@ -321,7 +321,6 @@
'buffer.copyToChannel(src10, ' + c + ', ' + startInChannel + ')',
buffer.getChannelData(c), 1, src10.length, startInChannel);
}
task.done();
});