Bug 815643 - Part 7: Add a basic API test for ConvolverNode; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 10 Jun 2013 16:09:38 -0400
changeset 134591 7cb2712f0237
parent 134590 22d7a1784228
child 134592 c78350f78192
push id29285
push usereakhgari@mozilla.com
push dateTue, 11 Jun 2013 00:10:14 +0000
treeherdermozilla-inbound@63386b71d1b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs815643
milestone24.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
Bug 815643 - Part 7: Add a basic API test for ConvolverNode; r=roc
content/media/webaudio/test/Makefile.in
content/media/webaudio/test/test_convolverNode.html
--- a/content/media/webaudio/test/Makefile.in
+++ b/content/media/webaudio/test/Makefile.in
@@ -46,16 +46,17 @@ MOCHITEST_FILES := \
   test_audioBufferSourceNodeLoopStartEndSame.html \
   test_audioBufferSourceNodeNullBuffer.html \
   test_badConnect.html \
   test_biquadFilterNode.html \
   test_channelMergerNode.html \
   test_channelMergerNodeWithVolume.html \
   test_channelSplitterNode.html \
   test_channelSplitterNodeWithVolume.html \
+  test_convolverNode.html \
   test_currentTime.html \
   test_delayNode.html \
   test_delayNodeSmallMaxDelay.html \
   test_delayNodeWithGain.html \
   test_dynamicsCompressorNode.html \
   test_gainNode.html \
   test_gainNodeInLoop.html \
   test_maxChannelCount.html \
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_convolverNode.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test the ConvolverNode interface</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script type="text/javascript" src="webaudio.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(function() {
+  SpecialPowers.setBoolPref("media.webaudio.enabled", true);
+
+  var context = new AudioContext();
+  var conv = context.createConvolver();
+
+  is(conv.channelCount, 2, "Convolver node has 2 input channels by default");
+  is(conv.channelCountMode, "clamped-max", "Correct channelCountMode for the Convolver node");
+  is(conv.channelInterpretation, "speakers", "Correct channelCountInterpretation for the Convolver node");
+
+  is(conv.buffer, null, "Default buffer value");
+  conv.buffer = context.createBuffer(2, 1024, 22050);
+  is(conv.normalize, true, "Default normalize value");
+
+  SpecialPowers.clearUserPref("media.webaudio.enabled");
+  SimpleTest.finish();
+});
+
+</script>
+</pre>
+</body>
+</html>