Bug 865244 - Test for AudioContext.destination.maxChannelCount. r=ehsan
authorPaul Adenot <paul@paul.cx>
Mon, 10 Jun 2013 19:32:28 +0200
changeset 134535 3443f1733c2219ef40d6e0f78652a61f15b7c860
parent 134534 f223d663d69136a1d710bbad5f6e1ced285b4189
child 134536 efa5667ea807bda2b9e1ff3b1b76f138a1c338d3
push id29254
push userpaul@paul.cx
push dateMon, 10 Jun 2013 17:33:04 +0000
treeherdermozilla-inbound@3443f1733c22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs865244
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 865244 - Test for AudioContext.destination.maxChannelCount. r=ehsan
content/media/webaudio/test/Makefile.in
content/media/webaudio/test/test_maxChannelCount.html
--- a/content/media/webaudio/test/Makefile.in
+++ b/content/media/webaudio/test/Makefile.in
@@ -53,16 +53,17 @@ MOCHITEST_FILES := \
   test_channelSplitterNodeWithVolume.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 \
   test_mediaDecoding.html \
   test_mixingRules.html \
   test_nodeToParamConnection.html \
   test_OfflineAudioContext.html \
   test_offlineDestinationChannelCountLess.html \
   test_offlineDestinationChannelCountMore.html \
   test_pannerNode.html \
   test_pannerNode_equalPower.html \
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_maxChannelCount.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test the AudioContext.destination 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 ac = new AudioContext();
+  ok(ac.destination.maxChannelCount > 0, "We can query the maximum number of channels");
+
+  var oac = new OfflineAudioContext(2, 1024, 48000);
+  ok(oac.destination.maxChannelCount, 2, "This OfflineAudioContext should have 2 max channels.");
+
+  oac = new OfflineAudioContext(6, 1024, 48000);
+  ok(oac.destination.maxChannelCount, 6, "This OfflineAudioContext should have 6 max channels.");
+
+  expectException(function() {
+    oac.destination.channelCount = oac.destination.channelCount + 1;
+  }, DOMException.INDEX_SIZE_ERR);
+
+  SpecialPowers.clearUserPref("media.webaudio.enabled");
+  SimpleTest.finish();
+});
+
+</script>
+</pre>
+</body>
+</html>