mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1414366 - Test ConstantSourceNode where stop has been called with the parameter lower or equal than the parameter to start. r=karlt
MozReview-Commit-ID: DDovVAs2M7S --HG-- extra : rebase_source : 32ee0d65272b5751f2d41b5f6ea1cd3057fcec48
This commit is contained in:
parent
bfb0d46900
commit
7996942c12
@ -37,6 +37,42 @@
|
||||
.then(() => task.done());
|
||||
});
|
||||
|
||||
audit.define('stop before start', (task, should) => {
|
||||
let context = new OfflineAudioContext(1, renderFrames, sampleRate);
|
||||
let node = new ConstantSourceNode(context, {offset: 1});
|
||||
node.connect(context.destination);
|
||||
node.start(61 / context.sampleRate);
|
||||
node.stop(31 / context.sampleRate);
|
||||
|
||||
context.startRendering()
|
||||
.then(function(buffer) {
|
||||
let actual = buffer.getChannelData(0);
|
||||
should(actual,
|
||||
"ConstantSourceNode with stop before " +
|
||||
"start must output silence")
|
||||
.beConstantValueOf(0);
|
||||
})
|
||||
.then(() => task.done());
|
||||
});
|
||||
|
||||
audit.define('stop equal to start', (task, should) => {
|
||||
let context = new OfflineAudioContext(1, renderFrames, sampleRate);
|
||||
let node = new ConstantSourceNode(context, {offset: 1});
|
||||
node.connect(context.destination);
|
||||
node.start(31 / context.sampleRate);
|
||||
node.stop(31 / context.sampleRate);
|
||||
|
||||
context.startRendering()
|
||||
.then(function(buffer) {
|
||||
let actual = buffer.getChannelData(0);
|
||||
should(actual,
|
||||
"ConstantSourceNode with stop equal to start " +
|
||||
" must output silence")
|
||||
.beConstantValueOf(0);
|
||||
})
|
||||
.then(() => task.done());
|
||||
});
|
||||
|
||||
audit.define('start/stop', (task, should) => {
|
||||
// Verify a constant source starts and stops at the correct time and has
|
||||
// the correct (fixed) value.
|
||||
|
Loading…
Reference in New Issue
Block a user