| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test Oscillator Node: triangle</title> | 4 <title>Test Oscillator Node: triangle</title> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audit.js"></script> | 8 <script src="../resources/audit.js"></script> |
| 9 <script src="../resources/buffer-loader.js"></script> | 9 <script src="../resources/buffer-loader.js"></script> |
| 10 <script src="../resources/oscillator-testing.js"></script> | 10 <script src="../resources/oscillator-testing.js"></script> |
| 11 </head> | 11 </head> |
| 12 | 12 |
| 13 <body> | 13 <body> |
| 14 <script> | 14 <script> |
| 15 let audit = Audit.createTaskRunner(); | 15 let audit = Audit.createTaskRunner(); |
| 16 let tester = OscillatorTestingUtils; | 16 let tester = OscillatorTestingUtils; |
| 17 | 17 |
| 18 audit.define("test", (task, should) => { | 18 audit.define("test", (task, should) => { |
| 19 let context = new OfflineAudioContext(1, tester.sampleRate * | 19 let context = new OfflineAudioContext(1, tester.sampleRate * |
| 20 tester.lengthInSeconds, tester.sampleRate); | 20 tester.lengthInSeconds, tester.sampleRate); |
| 21 | 21 |
| 22 // The thresholds are experimentally determined. | 22 // Thresholds for verifying the test passes. The thresholds are |
| 23 // experimentally determined. |
| 23 tester.setThresholds({ | 24 tester.setThresholds({ |
| 24 snr: 93.92, | 25 snr: 1000, |
| 25 maxDiff: 0.00005 | 26 maxDiff: 0, |
| 27 diffCount: 0 |
| 26 }); | 28 }); |
| 27 tester.runTest(context, "triangle", | 29 tester.runTest(context, "triangle", |
| 28 "Triangle Oscillator with Exponential Sweep ", task, should); | 30 "Triangle Oscillator with Exponential Sweep ", task, should); |
| 29 }); | 31 }); |
| 30 | 32 |
| 31 audit.run(); | 33 audit.run(); |
| 32 </script> | 34 </script> |
| 33 </body> | 35 </body> |
| 34 </html> | 36 </html> |
| OLD | NEW |