Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / webaudio / convolver-channels.html
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/compatibility.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <title>Test Supported Number of Channels for ConvolverNode</title>
8 </head>
9 <body>
10 <script>
11 description("Test Supported Number of Channels for ConvolverNode");
12 window.jsTestIsAsync = true;
13
14 function runTest() {
15     // Just need a context to create nodes on, so any allowed length and rate is ok.
16     var context = new OfflineAudioContext(1, 1, 48000);
17
18     for (var count = 1; count <= 32; ++count) {
19         var convolver = context.createConvolver();
20         var buffer = context.createBuffer(count, 1, context.sampleRate);
21         var message = "ConvolverNode with buffer of " + count + " channels";
22
23         if (count == 1 || count == 2 || count == 4) {
24             // These are the only valid channel counts for the buffer.
25             shouldNotThrow(function () {
26                 convolver.buffer = buffer;
27             }, message);
28         } else {
29             shouldThrowErrorName(function() {
30                 convolver.buffer = buffer;
31             }, "NotSupportedError", message);
32         }
33     }
34
35     finishJSTest();
36 }
37
38 runTest();
39 successfullyParsed = true;
40 </script>
41 </body>
42 </html>