| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test Oscillator Node: sawtooth</title> | 4 <title>Test Oscillator Node: sawtooth</title> |
| 5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audit.js"></script> |
| 6 <script src="../resources/buffer-loader.js"></script> | 9 <script src="../resources/buffer-loader.js"></script> |
| 7 <script src="../resources/oscillator-testing.js"></script> | 10 <script src="../resources/oscillator-testing.js"></script> |
| 8 </head> | 11 </head> |
| 9 | 12 |
| 10 <body> | 13 <body> |
| 11 <script> | 14 <script> |
| 12 description("Test Builtin Oscillator PeriodicWave Tables"); | 15 let audit = Audit.createTaskRunner(); |
| 13 | 16 |
| 14 // Create an offline context with a sample rate that is very different fro
m the sample rate | 17 // Create an offline context with a sample rate that is very different fro
m the sample rate |
| 15 // used in the OscillatorTestingUtils. This will create a internal Period
icWave objects for | 18 // used in the OscillatorTestingUtils. This will create a internal Period
icWave objects for |
| 16 // the Oscillator. This should not interfere with the oscillator test usi
ng a different | 19 // the Oscillator. This should not interfere with the oscillator test usi
ng a different |
| 17 // context with a different sample rate. | 20 // context with a different sample rate. |
| 18 | 21 |
| 19 var context = new OfflineAudioContext(1, 1, 3000); | 22 audit.define("test", (task, should) => { |
| 20 var osc = context.createOscillator(); | 23 let context0 = new OfflineAudioContext(1, 1, 3000); |
| 21 osc.type = "sawtooth"; | 24 let osc = context0.createOscillator(); |
| 22 osc = null; | 25 osc.type = "sawtooth"; |
| 26 osc = null; |
| 23 | 27 |
| 24 // This test is identical to the test in osc-sawtooth-sweep-snr.html. | 28 // This test is identical to the test in osc-sawtooth-sweep-snr.html. |
| 25 var tester = OscillatorTestingUtils; | 29 let tester = OscillatorTestingUtils; |
| 26 | 30 |
| 27 // The thresholds are experimentally determined. | 31 let context = new OfflineAudioContext(1, tester.sampleRate * |
| 28 tester.setThresholds({snr: 80.00, maxDiff: 4.06, diffCount: 15827}); | 32 tester.lengthInSeconds, tester.sampleRate); |
| 29 tester.runTest("sawtooth"); | 33 // The thresholds are experimentally determined. |
| 30 successfullyParsed = true; | 34 tester.setThresholds({ |
| 35 snr: 80.00, |
| 36 maxDiff: 4.06, |
| 37 diffCount: 15827 |
| 38 }); |
| 39 tester.runTest(context, "sawtooth", "Sawtooth PeriodicWave Test", |
| 40 task, should); |
| 41 }); |
| 42 |
| 43 audit.run(); |
| 31 </script> | 44 </script> |
| 32 </body> | 45 </body> |
| 33 </html> | 46 </html> |
| OLD | NEW |