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

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

Issue 2895963003: Apply layout-test-tidy to LayoutTests/webaudio (Closed)
Patch Set: Created 3 years, 7 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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/testharness.js"></script> 4 <title>
5 <script src="../../resources/testharnessreport.js"></script> 5 audioparam-setValueAtTime.html
6 <script src="../resources/audit-util.js"></script> 6 </title>
7 <script src="../resources/audit.js"></script> 7 <script src="../../resources/testharness.js"></script>
8 <script src="../resources/audioparam-testing.js"></script> 8 <script src="../../resources/testharnessreport.js"></script>
9 </head> 9 <script src="../resources/audit-util.js"></script>
10 <script src="../resources/audit.js"></script>
11 <script src="../resources/audioparam-testing.js"></script>
12 </head>
13 <body>
14 <script id="layout-test-code">
15 let audit = Audit.createTaskRunner();
10 16
11 <body> 17 // Play a long DC signal out through an AudioGainNode, and call
12 <script> 18 // setValueAtTime() at regular intervals to set the value for the duration
13 let audit = Audit.createTaskRunner(); 19 // of the interval. Each time interval has different value so that there
20 // is a discontinuity at each time interval boundary. The discontinuity
21 // is for testing timing.
14 22
15 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime() 23 // Number of tests to run.
16 // at regular intervals to set the value for the duration of the interval. Each 24 let numberOfTests = 100;
17 // time interval has different value so that there is a discontinuity at each
18 // time interval boundary. The discontinuity is for testing timing.
19 25
20 // Number of tests to run. 26 // Max allowed difference between the rendered data and the expected
21 let numberOfTests = 100; 27 // result.
28 let maxAllowedError = 6e-8;
22 29
23 // Max allowed difference between the rendered data and the expected result. 30 // Set the gain node value to the specified value at the specified time.
24 let maxAllowedError = 6e-8; 31 function setValue(value, time) {
32 gainNode.gain.setValueAtTime(value, time);
33 }
25 34
26 // Set the gain node value to the specified value at the specified time. 35 // For testing setValueAtTime(), we don't need to do anything for
27 function setValue(value, time) { 36 // automation. because the value at the beginning of the interval is set
28 gainNode.gain.setValueAtTime(value, time); 37 // by setValue and it remains constant for the duration, which is what we
29 } 38 // want.
39 function automation(value, startTime, endTime) {
40 // Do nothing.
41 }
30 42
31 // For testing setValueAtTime(), we don't need to do anything for automation. 43 audit.define(
32 // because the value at the beginning of the interval is set by setValue and it 44 {
33 // remains constant for the duration, which is what we want. 45 label: 'test',
34 function automation(value, startTime, endTime) { 46 description: 'AudioParam setValueAtTime() functionality.'
35 // Do nothing. 47 },
36 } 48 function(task, should) {
49 createAudioGraphAndTest(
50 task, should, numberOfTests, 1, setValue, automation,
51 'setValueAtTime()', maxAllowedError, createConstantArray);
52 });
37 53
38 audit.define({ 54 audit.run();
39 label: 'test', 55 </script>
40 description: 'AudioParam setValueAtTime() functionality.' 56 </body>
41 }, function(task, should) {
42 createAudioGraphAndTest(
43 task, should, numberOfTests, 1, setValue, automation, 'setValueAtTime()',
44 maxAllowedError, createConstantArray);
45 });
46
47 audit.run();
48 </script>
49
50 </body>
51 </html> 57 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698