summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webaudio/the-audio-api/the-dynamicscompressornode-interface/dynamicscompressor-basic.html
blob: 6c602010d0e3a9a7c4199b8923600676a5f5d3a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html>
  <head>
    <title>
      dynamicscompressor-basic.html
    </title>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script src="/webaudio/resources/audit-util.js"></script>
    <script src="/webaudio/resources/audit.js"></script>
  </head>
  <body>
    <script id="layout-test-code">
      let audit = Audit.createTaskRunner();
      let context;
      let compressor;

      audit.define(
          {
            label: 'test',
            description: 'Basic tests for DynamicsCompressorNode API'
          },
          function(task, should) {

            context = new AudioContext();
            compressor = context.createDynamicsCompressor();

            should(compressor.threshold.value, 'compressor.threshold.value')
                .beEqualTo(-24);
            should(compressor.knee.value, 'compressor.knee.value')
                .beEqualTo(30);
            should(compressor.ratio.value, 'compressor.ratio.value')
                .beEqualTo(12);
            should(compressor.attack.value, 'compressor.attack.value')
                .beEqualTo(Math.fround(0.003));
            should(compressor.release.value, 'compressor.release.value')
                .beEqualTo(0.25);
            should(typeof compressor.reduction, 'typeof compressor.reduction')
                .beEqualTo('number');
            should(compressor.reduction, 'compressor.reduction').beEqualTo(0);

            task.done();
          });

      audit.run();
    </script>
  </body>
</html>