[WebIDL] Enable strict type checking for nullable attribute setters of wrapper types
[WebKit-https.git] / LayoutTests / webaudio / panner-loop.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3   <head>
4     <script src="resources/audio-testing.js"></script>
5     <script src="../resources/js-test.js"></script>
6     <script src="resources/panner-model-testing.js"></script>
7   </head>
8
9   <body>
10     <div id="description"></div>
11     <div id="console"></div>
12     <script>
13       description("Test PannerNode handling of feedback loops");
14
15       // See webkit.org/b/150200
16       // See crbug.com/331446.
17
18       // Create a simple feedback loop and make sure the panner node processes it correctly.
19
20       function runTest() {
21           if (window.testRunner) {
22               testRunner.dumpAsText();
23               testRunner.waitUntilDone();
24           }
25
26           window.jsTestIsAsync = true;
27
28           var sampleRate = 44100;
29           var renderLengthSeconds = 1;
30       
31           // Create offline audio context.
32           var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
33
34           // Create nodes in graph. This is based on the test given in crbug.com/331446.
35           var source = context.createBufferSource();
36           source.buffer = createImpulseBuffer(context, sampleRate * renderLengthSeconds);
37           var activateNode = context.createGain();
38           var dry = context.createGain();
39           var wet = context.createGain();
40           var filter = context.createBiquadFilter();
41           var delay = context.createDelay();
42           var feedbackNode = context.createGain();
43           var output = context.createGain();
44
45           delay.delayTime.value = 0.1;
46           wet.gain.value = 0.5;
47           dry.gain.value = 1;
48           feedbackNode.gain.value = 0.45;
49           filter.frequency.value = 20000;
50
51           source.connect(activateNode);
52           activateNode.connect(delay);
53           activateNode.connect(dry);
54           delay.connect(filter);
55           filter.connect(feedbackNode);
56           feedbackNode.connect(delay);
57           feedbackNode.connect(wet);
58           wet.connect(output);
59           dry.connect(output);
60
61           var panner = context.createPanner();
62           panner.coneOuterGain = 0.1;
63           panner.coneOuterAngle = 180;
64           panner.coneInnerAngle = 0;
65
66           panner.connect(context.destination);
67
68           output.connect(panner);
69
70           // Render.  We don't care what the output is, though.
71
72           context.oncomplete = function (event) {
73                                    testPassed("Rendering successfully completed.");
74                                    finishJSTest();
75                                };
76           context.startRendering();
77       }
78       
79       runTest();
80       successfullyParsed = true;
81     </script>
82     
83   </body>
84 </html>