Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: timelapse
Fetching contributors…

Cannot retrieve contributors at this time

70 lines (52 sloc) 1.867 kB
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script type="text/javascript" src="resources/audio-testing.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script>
description("Basic tests for DynamicsCompressorNode API.");
var context;
var compressor;
function runTest() {
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
window.jsTestIsAsync = true;
context = new webkitAudioContext();
compressor = context.createDynamicsCompressor();
try {
if (compressor.threshold.value == -24)
testPassed("threshold attribute has correct default value.");
else
testFailed("threshold attribute has incorrect default value.");
if (compressor.knee.value == 30)
testPassed("knee attribute has correct default value.");
else
testFailed("knee attribute has incorrect default value.");
if (compressor.ratio.value == 12)
testPassed("ratio attribute has correct default value.");
else
testFailed("ratio attribute has incorrect default value.");
if (compressor.attack.value - 0.003 < 3e-8)
testPassed("attack attribute has correct default value.");
else
testFailed("attack attribute has incorrect default value.");
if (compressor.release.value - 0.25 < 3e-8)
testPassed("release attribute has correct default value.");
else
testFailed("release attribute has incorrect default value.");
} catch(e) {
testFailed("Exception thrown when accessing DynamicsCompressorNode attributes.");
}
finishJSTest();
}
runTest();
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.