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

Unified Diff: LayoutTests/webaudio/audioparam-exceptional-values.html

Issue 927333004: Add [TypeChecking=Unrestricted] to Web Audio interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/webaudio/audioparam-exceptional-values-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/webaudio/audioparam-exceptional-values.html
diff --git a/LayoutTests/webaudio/audioparam-exceptional-values.html b/LayoutTests/webaudio/audioparam-exceptional-values.html
index 9ab8dfc1a6f79d7386c0553b5e82182f725c33c1..535faf7df76b74a2ed4f43ac810151bb3bbb90e9 100644
--- a/LayoutTests/webaudio/audioparam-exceptional-values.html
+++ b/LayoutTests/webaudio/audioparam-exceptional-values.html
@@ -20,8 +20,12 @@
// invalid. Only finite non-negative values are allowed for any time or time-like parameter.
var timeValues = [-1, Infinity, -Infinity, NaN];
+ // For these duration values, AudioParam methods should throw an error because they are
+ // invalid. Only finite values are allowed for any duration parameter.
+ var durationValues = [-1, Infinity, -Infinity, NaN, 0];
+
// Just an array for use by setValueCurveAtTime. The length and contents of the array are not
- // important.
+ // important.
var curve = new Float32Array(10);
function runTest() {
@@ -35,33 +39,33 @@
gain = context.createGain();
// Test the value parameter
- for (value in targetValues) {
- shouldThrow("gain.gain.setValueAtTime(" + targetValues[value] + ", 1)");
- shouldThrow("gain.gain.linearRampToValueAtTime(" + targetValues[value] + ", 1)");
- shouldThrow("gain.gain.exponentialRampToValueAtTime(" + targetValues[value] + ", 1)");
- shouldThrow("gain.gain.setTargetAtTime(" + targetValues[value] + ", 1, 1)");
+ for (value of targetValues) {
+ shouldThrow("gain.gain.setValueAtTime(" + value + ", 1)");
+ shouldThrow("gain.gain.linearRampToValueAtTime(" + value + ", 1)");
+ shouldThrow("gain.gain.exponentialRampToValueAtTime(" + value + ", 1)");
+ shouldThrow("gain.gain.setTargetAtTime(" + value + ", 1, 1)");
}
// Test the time parameter
- for (startTime in timeValues) {
- shouldThrow("gain.gain.setValueAtTime(1, " + timeValues[startTime] + ")");
- shouldThrow("gain.gain.linearRampToValueAtTime(1, " + timeValues[startTime] + ")");
- shouldThrow("gain.gain.exponentialRampToValueAtTime(1, " + timeValues[startTime] + ")");
- shouldThrow("gain.gain.setTargetAtTime(1, " + timeValues[startTime] + ", 1)");
+ for (startTime of timeValues) {
+ shouldThrow("gain.gain.setValueAtTime(1, " + startTime + ")");
+ shouldThrow("gain.gain.linearRampToValueAtTime(1, " + startTime + ")");
+ shouldThrow("gain.gain.exponentialRampToValueAtTime(1, " + startTime + ")");
+ shouldThrow("gain.gain.setTargetAtTime(1, " + startTime + ", 1)");
}
// Test time constant
- for (value in targetValues) {
- shouldThrow("gain.gain.setTargetAtTime(1, 1, " + targetValues[value] + ")");
+ for (value of targetValues) {
+ shouldThrow("gain.gain.setTargetAtTime(1, 1, " + value + ")");
}
// Test startTime and duration for setValueCurveAtTime
- for (startTime in timeValues) {
- shouldThrow("gain.gain.setValueCurveAtTime(curve, " + timeValues[startTime] + ", 1)");
- shouldThrow("gain.gain.setValueCurveAtTime(curve, 1, " + timeValues[duration] + ")");
+ for (startTime of timeValues) {
+ shouldThrow("gain.gain.setValueCurveAtTime(curve, " + startTime + ", 1)");
+ }
+ for (duration of durationValues) {
+ shouldThrow("gain.gain.setValueCurveAtTime(curve, 1, " + duration + ")");
}
-
- shouldThrow("gain.gain.setValueCurveAtTime(curve, 1, 0)");
finishJSTest();
}
« no previous file with comments | « no previous file | LayoutTests/webaudio/audioparam-exceptional-values-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698