Bug 1413283 - ConstantSourceNode properties incorrect. r?padenot
channelCount should be 2.
MozReview-Commit-ID: 4yBVITUQJmg
--- 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/dom/media/webaudio/test/mochitest.ini
+++ b/dom/media/webaudio/test/mochitest.ini
@@ -102,16 +102,17 @@ tags=capturestream
[test_bug1113634.html]
[test_bug1118372.html]
[test_bug1027864.html]
[test_bug1056032.html]
skip-if = toolkit == 'android' # bug 1056706
[test_bug1255618.html]
[test_bug1267579.html]
[test_bug1355798.html]
+[test_bug1413283.html]
[test_channelMergerNode.html]
[test_channelMergerNodeWithVolume.html]
[test_channelSplitterNode.html]
[test_channelSplitterNodeWithVolume.html]
skip-if = (android_version == '18' && debug) # bug 1158417
[test_convolverNode.html]
[test_convolverNode_mono_mono.html]
[test_convolverNodeChannelCount.html]
new file mode 100644
--- /dev/null
+++ b/dom/media/webaudio/test/test_bug1413283.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Test ConstantSourceNode as channelCount equals 2</title>
+ <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+ let context = new AudioContext();
+ let source = new ConstantSourceNode(context);
+
+ is(source.channelCount, 2, "channelCount should be 2.");
+</script>
+</pre>
+</body>
+</html>