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

Unified Diff: third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp.html

Issue 1561483004: Correctly propagate end value for exponential ramp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp.html
diff --git a/third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp.html b/third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp.html
index f631366f151792f4140bed13e9c3b57eb07c40cc..56d1ae238e23568ea570f524c699617b74c6e4bb 100644
--- a/third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp.html
+++ b/third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp.html
@@ -111,6 +111,40 @@
}).then(done);
});
+ audit.defineTask("propagate", function (done) {
+ // Test propagation of ramp if the exponential ramp start and end values have opposite sign.
+ var renderDuration = 0.125;
+ var linearRampEnd = renderDuration / 4;
+ var exponentialRampEnd = renderDuration / 2;
+
+ var context = new OfflineAudioContext(1, renderDuration * sampleRate, sampleRate);
+ var source = context.createBufferSource();
+ source.buffer = createConstantBuffer(context, 1, 1);
+ source.loop = true;
+
+ var g = context.createGain();
+
+ g.gain.setValueAtTime(2, 0);
+ g.gain.linearRampToValueAtTime(-1, linearRampEnd);
+ g.gain.exponentialRampToValueAtTime(1, exponentialRampEnd);
+
+ source.connect(g)
+ .connect(context.destination);
+ source.start();
+
+ context.startRendering().then(function (resultBuffer) {
+ var actual = resultBuffer.getChannelData(0);
+
+ // Since the start value of the exponential ramp is -1 and the end value is 1, the ramp
+ // should just propagate -1 from the end of the linear ramp "forever".
+ var endFrame = Math.ceil(linearRampEnd * sampleRate);
+ Should("Exponential ramp from -1 to 1 after the end of the linear ramp",
+ actual.slice(endFrame))
+ .beConstantValueOf(-1);
+ }).then(done);
+
+ });
+
audit.defineTask("finish", function (done) {
finishJSTest();
done();
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/audioparam-negative-exponentialRamp-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698