1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/media/webaudio/test/test_maxChannelCount.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<head> 1.7 + <title>Test the AudioContext.destination interface</title> 1.8 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.9 + <script type="text/javascript" src="webaudio.js"></script> 1.10 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.11 +</head> 1.12 +<body> 1.13 +<pre id="test"> 1.14 +<script class="testbody" type="text/javascript"> 1.15 + 1.16 +// Work around bug 911777 1.17 +SpecialPowers.forceGC(); 1.18 +SpecialPowers.forceCC(); 1.19 + 1.20 +SimpleTest.waitForExplicitFinish(); 1.21 +addLoadEvent(function() { 1.22 + var ac = new AudioContext(); 1.23 + ok(ac.destination.maxChannelCount > 0, "We can query the maximum number of channels"); 1.24 + 1.25 + var oac = new OfflineAudioContext(2, 1024, 48000); 1.26 + ok(oac.destination.maxChannelCount, 2, "This OfflineAudioContext should have 2 max channels."); 1.27 + 1.28 + oac = new OfflineAudioContext(6, 1024, 48000); 1.29 + ok(oac.destination.maxChannelCount, 6, "This OfflineAudioContext should have 6 max channels."); 1.30 + 1.31 + expectException(function() { 1.32 + oac.destination.channelCount = oac.destination.channelCount + 1; 1.33 + }, DOMException.INDEX_SIZE_ERR); 1.34 + 1.35 + SimpleTest.finish(); 1.36 +}); 1.37 + 1.38 +</script> 1.39 +</pre> 1.40 +</body> 1.41 +</html>