5 <script src=
"../resources/js-test.js"></script>
6 <script src=
"resources/compatibility.js"></script>
7 <script type=
"text/javascript" src=
"resources/audio-testing.js"></script>
11 <div id=
"description"></div>
12 <div id=
"console"></div>
15 description("Basic tests for DynamicsCompressorNode API.");
21 if (window
.testRunner
) {
22 testRunner
.dumpAsText();
23 testRunner
.waitUntilDone();
26 window
.jsTestIsAsync
= true;
28 context
= new AudioContext();
29 compressor
= context
.createDynamicsCompressor();
32 if (compressor
.threshold
.value
== -24)
33 testPassed("threshold attribute has correct default value.");
35 testFailed("threshold attribute has incorrect default value.");
37 if (compressor
.knee
.value
== 30)
38 testPassed("knee attribute has correct default value.");
40 testFailed("knee attribute has incorrect default value.");
42 if (compressor
.ratio
.value
== 12)
43 testPassed("ratio attribute has correct default value.");
45 testFailed("ratio attribute has incorrect default value.");
47 if (compressor
.attack
.value
- 0.003 < 3e-8)
48 testPassed("attack attribute has correct default value.");
50 testFailed("attack attribute has incorrect default value.");
52 if (compressor
.release
.value
- 0.25 < 3e-8)
53 testPassed("release attribute has correct default value.");
55 testFailed("release attribute has incorrect default value.");
58 testFailed("Exception thrown when accessing DynamicsCompressorNode attributes.");