Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: third_party/WebKit/LayoutTests/webaudio/waveshaper-simple.html

Issue 2223613002: WaveShaperNode should copy its curve. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..53a6332d53313fadf31e531b203c9959d8774582
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webaudio/waveshaper-simple.html
@@ -0,0 +1,48 @@
+<!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/audio-testing.js"></script>
+ </head>
+
+ <body>
+ <script>
+ var audit = Audit.createTaskRunner();
+
+ audit.defineTask("simple", 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);
+
+ taskDone();
+ });
+
+ audit.runTasks();
+ </script>
+ </body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698