Initialize Tizen 2.3
[framework/web/webkit-efl.git] / LayoutTests / webaudio / dynamicscompressor-basic.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 <script type="text/javascript" src="resources/audio-testing.js"></script>
7 </head>
8
9 <body>
10 <div id="description"></div>
11 <div id="console"></div>
12
13 <script>
14 description("Basic tests for DynamicsCompressorNode API.");
15
16 var context;
17 var compressor;
18
19 function runTest() {
20     if (window.testRunner) {
21         testRunner.dumpAsText();
22         testRunner.waitUntilDone();
23     }
24     
25     window.jsTestIsAsync = true;
26
27     context = new webkitAudioContext();
28     compressor = context.createDynamicsCompressor();
29
30     try {
31         if (compressor.threshold.value == -24)
32             testPassed("threshold attribute has correct default value.");
33         else
34             testFailed("threshold attribute has incorrect default value.");
35
36         if (compressor.knee.value == 30)
37             testPassed("knee attribute has correct default value.");
38         else
39             testFailed("knee attribute has incorrect default value.");
40         
41         if (compressor.ratio.value == 12)
42             testPassed("ratio attribute has correct default value.");
43         else
44             testFailed("ratio attribute has incorrect default value.");
45         
46         if (compressor.attack.value - 0.003 < 3e-8)
47             testPassed("attack attribute has correct default value.");
48         else
49             testFailed("attack attribute has incorrect default value.");
50
51         if (compressor.release.value - 0.25 < 3e-8)
52             testPassed("release attribute has correct default value.");
53         else
54             testFailed("release attribute has incorrect default value.");
55
56     } catch(e) {
57         testFailed("Exception thrown when accessing DynamicsCompressorNode attributes.");
58     }
59
60     finishJSTest();
61 }
62
63 runTest();
64
65 </script>
66
67 <script src="../fast/js/resources/js-test-post.js"></script>
68 </body>
69 </html>