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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions.html

Issue 2020753002: Throw exception if curve is too short for setValueCurveAtTime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions.html b/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions.html
index 1774379a036eac5e50ef8431e2adc6b9ee93fc45..918f4552e13b00817b174768c961a6869d17c754 100644
--- a/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions.html
+++ b/third_party/WebKit/LayoutTests/webaudio/audioparam-setValueCurve-exceptions.html
@@ -243,6 +243,33 @@
done();
});
+ audit.defineTask("curve lengths", function (done) {
+ var success = true;
+ var context = new OfflineAudioContext(1, testDurationFrames, sampleRate);
+ var g = context.createGain();
+ var time = 0;
+
+ // Check for invalid curve lengths
+ success = Should("setValueCurveAtTime([], " + time + ", 0.01)", function () {
+ g.gain.setValueCurveAtTime(Float32Array.from([]), time, 0.01);
+ }).throw("InvalidStateError") && success;
+
+ success = Should("setValueCurveAtTime([1], " + time + ", 0.01)", function () {
+ g.gain.setValueCurveAtTime(Float32Array.from([1]), time, 0.01);
+ }).throw("InvalidStateError") && success;
+
+ success = Should("setValueCurveAtTime([1,2], " + time + ", 0.01)", function () {
+ g.gain.setValueCurveAtTime(Float32Array.from([1,2]), time, 0.01);
+ }).notThrow() && success;
+
+ if (success)
+ testPassed("Exceptions for curve length correctly handled.\n");
+ else
+ testFailed("Exceptions for curve length not correctly handled.\n");
+
+ done();
+ });
+
audit.defineTask("finish", function (done) {
finishJSTest();
done();

Powered by Google App Engine
This is Rietveld 408576698