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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-simple.html

Issue 2790893003: Convert WaveShaper tests to use new Audit (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>Simple Tests of WaveShaperNode</title> 4 <title>Simple Tests of WaveShaperNode</title>
5 <script src="../../resources/testharness.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script> 6 <script src="../../resources/testharnessreport.js"></script>
7 <script src="../resources/audit-util.js"></script> 7 <script src="../resources/audit-util.js"></script>
8 <script src="../resources/audio-testing.js"></script> 8 <script src="../resources/audit.js"></script>
9 </head> 9 </head>
10 10
11 <body> 11 <body>
12 <script> 12 <script>
13 var audit = Audit.createTaskRunner(); 13 var audit = Audit.createTaskRunner();
14 14
15 audit.defineTask("simple", function (taskDone) { 15 audit.define("simple", (task, should) => {
16 var context = new OfflineAudioContext(1, 1, 48000); 16 var context = new OfflineAudioContext(1, 1, 48000);
17 var shaper = context.createWaveShaper(); 17 var shaper = context.createWaveShaper();
18 18
19 // Verify default values are correct. 19 // Verify default values are correct.
20 Should("WaveShaper.curve", shaper.curve).beEqualTo(null); 20 should(shaper.curve, "WaveShaper.curve").beEqualTo(null);
21 Should("WaveShaper.oversample", shaper.oversample).beEqualTo("none"); 21 should(shaper.oversample, "WaveShaper.oversample").beEqualTo("none");
22 22
23 // Set oversample and verify that it is set correctly. 23 // Set oversample and verify that it is set correctly.
24 shaper.oversample = "2x"; 24 shaper.oversample = "2x";
25 Should('Waveshaper.oversample = "2x"', shaper.oversample).beEqualTo("2x" ); 25 should(shaper.oversample, 'Waveshaper.oversample = "2x"').beEqualTo("2x" );
26 26
27 shaper.oversample = "4x"; 27 shaper.oversample = "4x";
28 Should('Waveshaper.oversample = "4x"', shaper.oversample).beEqualTo("4x" ); 28 should(shaper.oversample, 'Waveshaper.oversample = "4x"').beEqualTo("4x" );
29 29
30 shaper.oversample = "invalid"; 30 shaper.oversample = "invalid";
31 Should('Waveshaper.oversample = "invalid"', shaper.oversample).beEqualTo ("4x"); 31 should(shaper.oversample, 'Waveshaper.oversample = "invalid"').beEqualTo ("4x");
32 32
33 // Set the curve and verify that the returned curve is the same as what 33 // Set the curve and verify that the returned curve is the same as what
34 // it was set to. 34 // it was set to.
35 var curve = Float32Array.from([-1, 0.25, .75]); 35 var curve = Float32Array.from([-1, 0.25, .75]);
36 shaper.curve = curve; 36 shaper.curve = curve;
37 Should("WaveShaper.curve", shaper.curve).beEqualToArray(curve); 37 should(shaper.curve, "WaveShaper.curve").beEqualToArray(curve);
38 38
39 // Verify setting the curve to null works. 39 // Verify setting the curve to null works.
40 shaper.curve = null; 40 shaper.curve = null;
41 Should("Waveshaper.curve = null", shaper.curve).beEqualTo(null); 41 should(shaper.curve, "Waveshaper.curve = null").beEqualTo(null);
42 42
43 taskDone(); 43 task.done();
44 }); 44 });
45 45
46 audit.runTasks(); 46 audit.run();
47 </script> 47 </script>
48 </body> 48 </body>
49 </html> 49 </html>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698