test for bug 933304
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 28 Jan 2014 18:14:24 +1300
changeset 181747 2b9dfa78a4c7f64c25903a1877ade82e78671615
parent 181746 931b7b9749bcf88e64687ffda794364db35d10a7
child 181748 be857f605b786c02c7870a12bbf3fdbec05f7c72
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs933304
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
test for bug 933304
content/media/webaudio/test/mochitest.ini
content/media/webaudio/test/test_stereoPanningWithGain.html
--- a/content/media/webaudio/test/mochitest.ini
+++ b/content/media/webaudio/test/mochitest.ini
@@ -105,15 +105,16 @@ support-files =
 [test_pannerNodeChannelCount.html]
 [test_pannerNodeTail.html]
 [test_pannerNode_equalPower.html]
 [test_periodicWave.html]
 [test_scriptProcessorNode.html]
 [test_scriptProcessorNodeChannelCount.html]
 [test_scriptProcessorNodeZeroInputOutput.html]
 [test_scriptProcessorNodeNotConnected.html]
+[test_stereoPanningWithGain.html]
 [test_singleSourceDest.html]
 [test_waveShaper.html]
 [test_waveShaperNoCurve.html]
 [test_waveShaperZeroLengthCurve.html]
 [test_audioDestinationNode.html]
 [test_mozaudiochannel.html]
 [test_waveDecoder.html]
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_stereoPanningWithGain.html
@@ -0,0 +1,49 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test stereo equalpower panning with a GainNode</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 src="webaudio.js" type="text/javascript"></script>
+<script class="testbody" type="text/javascript">
+
+const size = 256;
+
+var gTest = {
+  numberOfChannels: 2,
+  createGraph: function(context) {
+    var panner = context.createPanner();
+    panner.setPosition(1.0, 0.0, 0.0); // reference distance the right
+    panner.panningModel = "equalpower";
+
+    var gain = context.createGain();
+    gain.gain.value = -0.5;
+    gain.connect(panner);
+
+    var buffer = context.createBuffer(2, 2, context.sampleRate);
+    buffer.getChannelData(0)[0] = 1.0;
+    buffer.getChannelData(1)[1] = 1.0;
+    var source = context.createBufferSource();
+    source.buffer = buffer;
+    source.connect(gain);
+    source.start(0);
+
+    return panner;
+  },
+  createExpectedBuffers: function(context) {
+    var expectedBuffer = context.createBuffer(2, size, context.sampleRate);
+    expectedBuffer.getChannelData(1)[0] = -0.5;
+    expectedBuffer.getChannelData(1)[1] = -0.5;
+    return expectedBuffer;
+  },
+};
+
+runTest();
+
+</script>
+</pre>
+</body>
+</html>