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