5 <script src="../fast/js/resources/js-test-pre.js"></script>
6 <script type="text/javascript" src="resources/audio-testing.js"></script>
10 <div id="description"></div>
11 <div id="console"></div>
14 description("Basic tests for DynamicsCompressorNode API.");
20 if (window.testRunner) {
21 testRunner.dumpAsText();
22 testRunner.waitUntilDone();
25 window.jsTestIsAsync = true;
27 context = new webkitAudioContext();
28 compressor = context.createDynamicsCompressor();
31 if (compressor.threshold.value == -24)
32 testPassed("threshold attribute has correct default value.");
34 testFailed("threshold attribute has incorrect default value.");
36 if (compressor.knee.value == 30)
37 testPassed("knee attribute has correct default value.");
39 testFailed("knee attribute has incorrect default value.");
41 if (compressor.ratio.value == 12)
42 testPassed("ratio attribute has correct default value.");
44 testFailed("ratio attribute has incorrect default value.");
46 if (compressor.attack.value - 0.003 < 3e-8)
47 testPassed("attack attribute has correct default value.");
49 testFailed("attack attribute has incorrect default value.");
51 if (compressor.release.value - 0.25 < 3e-8)
52 testPassed("release attribute has correct default value.");
54 testFailed("release attribute has incorrect default value.");
57 testFailed("Exception thrown when accessing DynamicsCompressorNode attributes.");
67 <script src="../fast/js/resources/js-test-post.js"></script>