[Apple Pay] Clean up handling of summary items and payment method updates
[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           window.jsTestIsAsync = true;
22
23           var sampleRate = 44100;
24           var renderLengthSeconds = 1;
25       
26           // Create offline audio context.
27           var context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
28
29           // Create nodes in graph. This is based on the test given in crbug.com/331446.
30           var source = context.createBufferSource();
31           source.buffer = createImpulseBuffer(context, sampleRate * renderLengthSeconds);
32           var activateNode = context.createGain();
33           var dry = context.createGain();
34           var wet = context.createGain();
35           var filter = context.createBiquadFilter();
36           var delay = context.createDelay();
37           var feedbackNode = context.createGain();
38           var output = context.createGain();
39
40           delay.delayTime.value = 0.1;
41           wet.gain.value = 0.5;
42           dry.gain.value = 1;
43           feedbackNode.gain.value = 0.45;
44           filter.frequency.value = 20000;
45
46           source.connect(activateNode);
47           activateNode.connect(delay);
48           activateNode.connect(dry);
49           delay.connect(filter);
50           filter.connect(feedbackNode);
51           feedbackNode.connect(delay);
52           feedbackNode.connect(wet);
53           wet.connect(output);
54           dry.connect(output);
55
56           var panner = context.createPanner();
57           panner.coneOuterGain = 0.1;
58           panner.coneOuterAngle = 180;
59           panner.coneInnerAngle = 0;
60
61           panner.connect(context.destination);
62
63           output.connect(panner);
64
65           // Render.  We don't care what the output is, though.
66
67           context.oncomplete = function (event) {
68                                    testPassed("Rendering successfully completed.");
69                                    finishJSTest();
70                                };
71           context.startRendering();
72       }
73       
74       runTest();
75     </script>
76     
77   </body>
78 </html>