Implement OfflineAudioContext constructor
[WebKit-https.git] / LayoutTests / webaudio / panner-equalpower.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3   <head>
4     <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/>
5     <script src="resources/audio-testing.js"></script>
6     <script src="../fast/js/resources/js-test-pre.js"></script>
7     <script src="resources/panner-model-testing.js"></script>
8   </head>
9
10   <body>
11     <div id="description"></div>
12     <div id="console"></div>
13
14     <script>
15       description("Test equal-power panner model of AudioPannerNode.");
16
17       // To test the panner, we create a number of panner nodes
18       // equally spaced on a semicircle at unit distance.  The
19       // semicircle covers the azimuth range from -90 to 90 deg,
20       // covering full left to full right.  Each source is an impulse
21       // turning at a different time and we check that the rendered
22       // impulse has the expected gain.
23       function runTest() {
24           if (window.testRunner) {
25               testRunner.dumpAsText();
26               testRunner.waitUntilDone();
27           }
28
29           window.jsTestIsAsync = true;
30
31           // Create offline audio context.
32           context = new webkitOfflineAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
33
34           createTestAndRun(context, nodesToCreate, 1);
35       }
36
37       runTest();
38       successfullyParsed = true;
39
40     </script>
41
42     <script src="../fast/js/resources/js-test-post.js"></script>
43   </body>
44 </html>