Bug 1456266 - In ConstantSourceNode change the default channelCount to align with the spec. r?padenot
MozReview-Commit-ID: 9cvAztPuZic
--- a/dom/media/webaudio/ConstantSourceNode.cpp
+++ b/dom/media/webaudio/ConstantSourceNode.cpp
@@ -141,17 +141,17 @@ public:
RefPtr<AudioNodeStream> mDestination;
StreamTime mStart;
StreamTime mStop;
AudioParamTimeline mOffset;
};
ConstantSourceNode::ConstantSourceNode(AudioContext* aContext)
: AudioScheduledSourceNode(aContext,
- 1,
+ 2,
ChannelCountMode::Max,
ChannelInterpretation::Speakers)
, mOffset(new AudioParam(this, ConstantSourceNodeEngine::OFFSET,
"offset", 1.0f))
, mStartCalled(false)
{
ConstantSourceNodeEngine* engine = new ConstantSourceNodeEngine(this, aContext->Destination());
mStream = AudioNodeStream::Create(aContext, engine,
--- a/testing/web-platform/meta/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html.ini
+++ b/testing/web-platform/meta/webaudio/the-audio-api/the-constantsourcenode-interface/constant-source-basic.html.ini
@@ -1,31 +1,25 @@
[constant-source-basic.html]
- [X Factory method: node.channelCount is not equal to 2. Got 1.]
- expected: FAIL
-
[X Factory method: node.offset.minValue is not equal to -3.4028234663852886e+38. Got -Infinity.]
expected: FAIL
[X Factory method: node.offset.maxValue is not equal to 3.4028234663852886e+38. Got Infinity.]
expected: FAIL
- [< [createConstantSource()\] 3 out of 11 assertions were failed.]
- expected: FAIL
-
- [X Constructor: node.channelCount is not equal to 2. Got 1.]
+ [< [createConstantSource()\] 2 out of 11 assertions were failed.]
expected: FAIL
[X Constructor: node.offset.minValue is not equal to -3.4028234663852886e+38. Got -Infinity.]
expected: FAIL
[X Constructor: node.offset.maxValue is not equal to 3.4028234663852886e+38. Got Infinity.]
expected: FAIL
- [< [new ConstantSourceNode()\] 3 out of 11 assertions were failed.]
+ [< [new ConstantSourceNode()\] 2 out of 11 assertions were failed.]
expected: FAIL
[X start(-1) threw "NotSupportedError" instead of RangeError.]
expected: FAIL
[X stop(-1) threw "NotSupportedError" instead of RangeError.]
expected: FAIL