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

Side by Side 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: Add tests for setting attributes and verifying them. 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 unified diff | Download patch
OLDNEW
(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/compatibility.js"></script>
hongchan 2016/08/11 18:48:58 Ditto.
Raymond Toy 2016/08/11 20:11:47 Done.
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 () {
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).beNull();
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).beNull();
42
43 done();
44 });
45
46 audit.runTasks();
47 </script>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698