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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/audioparam-exceptional-values.html

Issue 1897293002: Throw error if timeConstant is not positive for setTargetAtTime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/audioparam-exceptional-values-expected.txt » ('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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="resources/compatibility.js"></script> 4 <script src="resources/compatibility.js"></script>
5 <script src="../resources/js-test.js"></script> 5 <script src="../resources/js-test.js"></script>
6 </head> 6 </head>
7 7
8 <body> 8 <body>
9 <script> 9 <script>
10 description("Test exceptional arguments for AudioParam timeline events"); 10 description("Test exceptional arguments for AudioParam timeline events");
11 11
12 var context; 12 var context;
13 var gain; 13 var gain;
14 14
15 // For these values, AudioParam methods should throw an error because they are invalid; only 15 // For these values, AudioParam methods should throw an error because they are invalid; only
16 // finite values are allowed. 16 // finite values are allowed.
17 var targetValues = [Infinity, -Infinity, NaN]; 17 var targetValues = [Infinity, -Infinity, NaN];
18 18
19 // For these time values, AudioParam methods should throw an error because they are 19 // For these time values, AudioParam methods should throw an error because they are
20 // invalid. Only finite non-negative values are allowed for any time or ti me-like parameter. 20 // invalid. Only finite non-negative values are allowed for any time or ti me-like parameter.
21 var timeValues = [-1, Infinity, -Infinity, NaN]; 21 var timeValues = [-1, Infinity, -Infinity, NaN];
22 22
23 // For these duration values, AudioParam methods should throw an error bec ause they are 23 // For these duration values, AudioParam methods should throw an error bec ause they are
24 // invalid. Only finite values are allowed for any duration parameter. 24 // invalid. Only finite values are allowed for any duration parameter.
25 var durationValues = [-1, Infinity, -Infinity, NaN, 0]; 25 var durationValues = [-1, Infinity, -Infinity, NaN, 0];
26 26
27 // For these timeConstant values for setTargetAtTime an error must be thro wn because they are
28 // invalid.
29 var timeConstantValues = [-1, 0, Infinity, -Infinity, NaN];
30
27 // Just an array for use by setValueCurveAtTime. The length and contents o f the array are not 31 // Just an array for use by setValueCurveAtTime. The length and contents o f the array are not
28 // important. 32 // important.
29 var curve = new Float32Array(10); 33 var curve = new Float32Array(10);
30 34
31 function runTest() { 35 function runTest() {
32 if (window.testRunner) { 36 if (window.testRunner) {
33 testRunner.dumpAsText(); 37 testRunner.dumpAsText();
34 testRunner.waitUntilDone(); 38 testRunner.waitUntilDone();
35 } 39 }
36 window.jsTestIsAsync = true; 40 window.jsTestIsAsync = true;
(...skipping 11 matching lines...) Expand all
48 52
49 // Test the time parameter 53 // Test the time parameter
50 for (startTime of timeValues) { 54 for (startTime of timeValues) {
51 shouldThrow("gain.gain.setValueAtTime(1, " + startTime + ")"); 55 shouldThrow("gain.gain.setValueAtTime(1, " + startTime + ")");
52 shouldThrow("gain.gain.linearRampToValueAtTime(1, " + startTime + ")") ; 56 shouldThrow("gain.gain.linearRampToValueAtTime(1, " + startTime + ")") ;
53 shouldThrow("gain.gain.exponentialRampToValueAtTime(1, " + startTime + ")"); 57 shouldThrow("gain.gain.exponentialRampToValueAtTime(1, " + startTime + ")");
54 shouldThrow("gain.gain.setTargetAtTime(1, " + startTime + ", 1)"); 58 shouldThrow("gain.gain.setTargetAtTime(1, " + startTime + ", 1)");
55 } 59 }
56 60
57 // Test time constant 61 // Test time constant
58 for (value of targetValues) { 62 for (value of timeConstantValues) {
59 shouldThrow("gain.gain.setTargetAtTime(1, 1, " + value + ")"); 63 shouldThrow("gain.gain.setTargetAtTime(1, 1, " + value + ")");
60 } 64 }
61 65
62 // Test startTime and duration for setValueCurveAtTime 66 // Test startTime and duration for setValueCurveAtTime
63 for (startTime of timeValues) { 67 for (startTime of timeValues) {
64 shouldThrow("gain.gain.setValueCurveAtTime(curve, " + startTime + ", 1 )"); 68 shouldThrow("gain.gain.setValueCurveAtTime(curve, " + startTime + ", 1 )");
65 } 69 }
66 for (duration of durationValues) { 70 for (duration of durationValues) {
67 shouldThrow("gain.gain.setValueCurveAtTime(curve, 1, " + duration + ") "); 71 shouldThrow("gain.gain.setValueCurveAtTime(curve, 1, " + duration + ") ");
68 } 72 }
69 73
70 finishJSTest(); 74 finishJSTest();
71 } 75 }
72 76
73 runTest(); 77 runTest();
74 successfullyParsed = true; 78 successfullyParsed = true;
75 </script> 79 </script>
76 </body> 80 </body>
77 </html> 81 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/audioparam-exceptional-values-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698