Index: third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime.html |
diff --git a/third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime.html b/third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..99523d2c0c3f6b7ff6e0c7026285e460bef1506f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime.html |
@@ -0,0 +1,75 @@ |
+<!doctype html> |
+<html> |
+ <head> |
+ <script src="../resources/js-test.js"></script> |
+ <script src="resources/compatibility.js"></script> |
+ <script src="resources/audio-testing.js"></script> |
+ <title>AudioParam with Huge End Time</title> |
+ </head> |
+ |
+ <body> |
+ <script> |
+ description("Test AudioParam with Huge Time Value") |
+ window.jsTestIsAsync = true; |
+ |
+ var sampleRate = 48000; |
+ // Render for some small (but fairly arbitrary) time. |
+ var renderDuration = 0.125; |
+ // Any huge time value that won't fit in a size_t (2^64 on a 64-bit machine). |
+ var largeTime = 1e300; |
+ |
+ var audit = Audit.createTaskRunner(); |
+ |
+ // See crbug.com/582701. Create an audioparam with a huge end time and verify that to |
hongchan
2016/02/02 17:07:42
The URL does not exist. Typo?
Raymond Toy
2016/02/02 17:34:47
It works for me.
|
+ // automation is run. We don't care about the actual results, just that it runs. |
+ |
+ // Test linear ramp with huge end time |
hongchan
2016/02/02 17:07:42
This test only covers linear and expo. Do we need
Raymond Toy
2016/02/02 17:34:47
I just wanted to fix the immediate issue. I filed
|
+ audit.defineTask("linearRamp", function (done) { |
+ var graph = createGraph(); |
+ graph.gain.gain.linearRampToValueAtTime(0.1, largeTime); |
+ |
+ graph.source.start(); |
+ graph.context.startRendering().then(function (buffer) { |
+ testPassed("linearRampToValue(0.1, " + largeTime + ") successfully rendered."); |
+ }).then(done); |
+ }); |
+ |
+ // Test exponential ramp with huge end time |
+ audit.defineTask("exponentialRamp", function (done) { |
+ var graph = createGraph(); |
+ graph.gain.gain.exponentialRampToValueAtTime(.1, largeTime); |
+ |
+ graph.source.start(); |
+ graph.context.startRendering().then(function (buffer) { |
+ testPassed("exponentialRampToValue(0.1, " + largeTime + ") successfully rendered."); |
+ }).then(done); |
+ }); |
+ |
+ audit.defineTask("finish", function (done) { |
+ finishJSTest(); |
+ done(); |
+ }); |
+ |
+ audit.runTasks(); |
+ |
+ // Create the graph and return the context, the source, and the gain node. |
+ function createGraph() { |
+ var context = new OfflineAudioContext(1, renderDuration * sampleRate, sampleRate); |
+ var src = context.createBufferSource(); |
+ src.buffer = createConstantBuffer(context, 1, 1); |
+ src.loop = true; |
+ var gain = context.createGain(); |
+ src.connect(gain); |
+ gain.connect(context.destination); |
+ gain.gain.setValueAtTime(1, 0.1 / sampleRate); |
+ |
+ return { |
+ context: context, |
+ gain: gain, |
+ source: src |
+ }; |
+ } |
+ |
+ </script> |
+ </body> |
+</html> |