Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/webaudio/waveshaper-simple.html |
| diff --git a/third_party/WebKit/LayoutTests/webaudio/waveshaper-simple.html b/third_party/WebKit/LayoutTests/webaudio/waveshaper-simple.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2dec7c6e136e09e6abb5f5164fab88df07582051 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/webaudio/waveshaper-simple.html |
| @@ -0,0 +1,49 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Simple Tests of WaveShaperNode</title> |
| + <script src="../resources/testharness.js"></script> |
| + <script src="../resources/testharnessreport.js"></script> |
| + <script src="resources/compatibility.js"></script> |
|
hongchan
2016/08/11 18:48:58
I suggest to remove this check.
|
| + <script src="resources/audio-testing.js"></script> |
| + </head> |
| + |
| + <body> |
| + <script> |
| + var audit = Audit.createTaskRunner(); |
| + |
| + audit.defineTask("simple", function () { |
|
hongchan
2016/08/11 18:48:58
function (taskDone) {
|
| + var context = new OfflineAudioContext(1, 1, 48000); |
| + var shaper = context.createWaveShaper(); |
| + |
| + // Verify default values are correct. |
| + Should("WaveShaper.curve", shaper.curve).beEqualTo(null); |
| + Should("WaveShaper.oversample", shaper.oversample).beEqualTo("none"); |
| + |
| + // Set oversample and verify that it is set correctly. |
| + shaper.oversample = "2x"; |
| + Should('Waveshaper.oversample = "2x"', shaper.oversample).beEqualTo("2x"); |
| + |
| + shaper.oversample = "4x"; |
| + Should('Waveshaper.oversample = "4x"', shaper.oversample).beEqualTo("4x"); |
| + |
| + shaper.oversample = "invalid"; |
| + Should('Waveshaper.oversample = "invalid"', shaper.oversample).beEqualTo("4x"); |
| + |
| + // Set the curve and verify that the returned curve is the same as what |
| + // it was set to. |
| + var curve = Float32Array.from([-1, 0.25, .75]); |
| + shaper.curve = curve; |
| + Should("WaveShaper.curve", shaper.curve).beEqualToArray(curve); |
| + |
| + // Verify setting the curve to null works. |
| + shaper.curve = null; |
| + Should("Waveshaper.curve = null", shaper.curve).beEqualTo(null); |
| + |
| + done(); |
|
hongchan
2016/08/11 18:48:58
This is wrong. This will finish the testharness, n
|
| + }); |
| + |
| + audit.runTasks(); |
| + </script> |
| + </body> |
| +</html> |