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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-copy-curve.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 | « no previous file | third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-simple.html » ('j') | 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>Test WaveShaper Copies Curve Data</title> 4 <title>Test WaveShaper Copies Curve Data</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 // Sample rate and number of frames are fairly arbitrary. We need to 13 // Sample rate and number of frames are fairly arbitrary. We need to
14 // render, however, at least 384 frames. 1024 is a nice small value. 14 // render, however, at least 384 frames. 1024 is a nice small value.
15 var sampleRate = 16000; 15 var sampleRate = 16000;
16 var renderFrames = 1024; 16 var renderFrames = 1024;
17 17
18 var audit = Audit.createTaskRunner(); 18 var audit = Audit.createTaskRunner();
19 19
20 audit.defineTask("test copying", function (taskDone) { 20 audit.define("test copying", (task, should) => {
21 // Two-channel context; channel 0 contains the test data and channel 1 21 // Two-channel context; channel 0 contains the test data and channel 1
22 // contains the expected result. Channel 1 has the normal WaveShaper 22 // contains the expected result. Channel 1 has the normal WaveShaper
23 // output and channel 0 has the WaveShaper output with a modified curve. 23 // output and channel 0 has the WaveShaper output with a modified curve.
24 var context = new OfflineAudioContext(2, renderFrames, sampleRate); 24 var context = new OfflineAudioContext(2, renderFrames, sampleRate);
25 25
26 // Just use a default oscillator as the source. Doesn't really matter 26 // Just use a default oscillator as the source. Doesn't really matter
27 // what we use. 27 // what we use.
28 var src = context.createOscillator(); 28 var src = context.createOscillator();
29 src.type = "sawtooth"; 29 src.type = "sawtooth";
30 30
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 .then(context.resume.bind(context)); 66 .then(context.resume.bind(context));
67 67
68 src.start(); 68 src.start();
69 69
70 context.startRendering().then(function (renderedBuffer) { 70 context.startRendering().then(function (renderedBuffer) {
71 var actual = renderedBuffer.getChannelData(0); 71 var actual = renderedBuffer.getChannelData(0);
72 var expected = renderedBuffer.getChannelData(1); 72 var expected = renderedBuffer.getChannelData(1);
73 73
74 // Modifying the wave shaper curve should not modify the output so the 74 // Modifying the wave shaper curve should not modify the output so the
75 // outputs from the two wave shaper nodes should be exactly identical. 75 // outputs from the two wave shaper nodes should be exactly identical.
76 var success = Should("WaveShaper with modified curve", actual) 76 should(actual, "WaveShaper with modified curve")
77 .beEqualToArray(expected); 77 .beEqualToArray(expected);
78 78
79 Should("Summary: ", success).summarize( 79 }).then(() => task.done());
80 "Output correctly did not change with modified WaveShaper curve.",
81 "Output incorrectly changed due to modified WaveShaper curve.");
82 }).then(taskDone);
83 }); 80 });
84 81
85 audit.runTasks(); 82 audit.run();
86 </script> 83 </script>
87 </body> 84 </body>
88 </html> 85 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/WaveShaper/waveshaper-simple.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698