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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/AudioParam/audioparam-initial-event.html

Issue 2658703002: Convert AudioParam Audit tests to testharness (Closed)
Patch Set: Rebase test Created 3 years, 10 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
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 3
4 <head> 4 <head>
5 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
6 <script src="../resources/audit-util.js"></script> 7 <script src="../resources/audit-util.js"></script>
7 <script src="../resources/audio-testing.js"></script> 8 <script src="../resources/audio-testing.js"></script>
8 <script src="../resources/audioparam-testing.js"></script> 9 <script src="../resources/audioparam-testing.js"></script>
9 <title>AudioParam Initial Events </title> 10 <title>AudioParam Initial Events </title>
10 </head> 11 </head>
11 12
12 <body> 13 <body>
13 <script> 14 <script>
14 description("Test Automation Ramps without Initial Event");
15 window.jsTestIsAsync = true;
16 15
17 var sampleRate = 48000; 16 var sampleRate = 48000;
18 // Number of frames in a rendering quantum. 17 // Number of frames in a rendering quantum.
19 var quantumFrames = 128; 18 var quantumFrames = 128;
20 // Test doesn't need to run for very long. 19 // Test doesn't need to run for very long.
21 var renderDuration = 0.2; 20 var renderDuration = 0.2;
22 var renderFrames = renderDuration * sampleRate; 21 var renderFrames = renderDuration * sampleRate;
23 var automationEndTime = 0.1; 22 var automationEndTime = 0.1;
24 23
25 var audit = Audit.createTaskRunner(); 24 var audit = Audit.createTaskRunner();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // The starting value of the gain node 84 // The starting value of the gain node
86 v0: 0.5, 85 v0: 0.5,
87 // The target value of the automation 86 // The target value of the automation
88 v1: 2, 87 v1: 2,
89 delay: quantumFrames / sampleRate 88 delay: quantumFrames / sampleRate
90 }) 89 })
91 .then(done); 90 .then(done);
92 }); 91 });
93 92
94 audit.defineTask("finish", function (done) { 93 audit.defineTask("finish", function (done) {
95 finishJSTest();
96 done(); 94 done();
97 }); 95 });
98 96
99 audit.runTasks(); 97 audit.runTasks();
100 98
101 // Generate the expected waveform for a linear ramp starting from the value |v0|, ramping to 99 // Generate the expected waveform for a linear ramp starting from the value |v0|, ramping to
102 // |v1| at time |endTime|. The time of |v0| is assumed to be 0. |nFrames| is how many frames 100 // |v1| at time |endTime|. The time of |v0| is assumed to be 0. |nFrames| is how many frames
103 // to generate. 101 // to generate.
104 function linearRamp(v0, v1, startTime, endTime, nFrames) { 102 function linearRamp(v0, v1, startTime, endTime, nFrames) {
105 var expected = createLinearRampArray(startTime, endTime, v0, v1, sampleRat e); 103 var expected = createLinearRampArray(startTime, endTime, v0, v1, sampleRat e);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 .then(function (resultBuffer) { 164 .then(function (resultBuffer) {
167 var result = resultBuffer.getChannelData(0); 165 var result = resultBuffer.getChannelData(0);
168 var expected = referenceFunction(v0, v1, delay ? delay : 0, automation EndTime, renderFrames); 166 var expected = referenceFunction(v0, v1, delay ? delay : 0, automation EndTime, renderFrames);
169 Should(message, result).beCloseToArray(expected, threshold); 167 Should(message, result).beCloseToArray(expected, threshold);
170 }); 168 });
171 } 169 }
172 </script> 170 </script>
173 </body> 171 </body>
174 172
175 </html> 173 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698