| OLD | NEW |
| (Empty) |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <title>Simple Tests of WaveShaperNode</title> | |
| 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/audio-testing.js"></script> | |
| 9 </head> | |
| 10 | |
| 11 <body> | |
| 12 <script> | |
| 13 var audit = Audit.createTaskRunner(); | |
| 14 | |
| 15 audit.defineTask("simple", function (taskDone) { | |
| 16 var context = new OfflineAudioContext(1, 1, 48000); | |
| 17 var shaper = context.createWaveShaper(); | |
| 18 | |
| 19 // Verify default values are correct. | |
| 20 Should("WaveShaper.curve", shaper.curve).beEqualTo(null); | |
| 21 Should("WaveShaper.oversample", shaper.oversample).beEqualTo("none"); | |
| 22 | |
| 23 // Set oversample and verify that it is set correctly. | |
| 24 shaper.oversample = "2x"; | |
| 25 Should('Waveshaper.oversample = "2x"', shaper.oversample).beEqualTo("2x"
); | |
| 26 | |
| 27 shaper.oversample = "4x"; | |
| 28 Should('Waveshaper.oversample = "4x"', shaper.oversample).beEqualTo("4x"
); | |
| 29 | |
| 30 shaper.oversample = "invalid"; | |
| 31 Should('Waveshaper.oversample = "invalid"', shaper.oversample).beEqualTo
("4x"); | |
| 32 | |
| 33 // Set the curve and verify that the returned curve is the same as what | |
| 34 // it was set to. | |
| 35 var curve = Float32Array.from([-1, 0.25, .75]); | |
| 36 shaper.curve = curve; | |
| 37 Should("WaveShaper.curve", shaper.curve).beEqualToArray(curve); | |
| 38 | |
| 39 // Verify setting the curve to null works. | |
| 40 shaper.curve = null; | |
| 41 Should("Waveshaper.curve = null", shaper.curve).beEqualTo(null); | |
| 42 | |
| 43 taskDone(); | |
| 44 }); | |
| 45 | |
| 46 audit.runTasks(); | |
| 47 </script> | |
| 48 </body> | |
| 49 </html> | |
| OLD | NEW |