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

Side by Side Diff: third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime.html

Issue 1657593003: Carefully handle large end time values in AudioParam automations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime-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
(Empty)
1 <!doctype html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/compatibility.js"></script>
6 <script src="resources/audio-testing.js"></script>
7 <title>AudioParam with Huge End Time</title>
8 </head>
9
10 <body>
11 <script>
12 description("Test AudioParam with Huge Time Value")
13 window.jsTestIsAsync = true;
14
15 var sampleRate = 48000;
16 // Render for some small (but fairly arbitrary) time.
17 var renderDuration = 0.125;
18 // Any huge time value that won't fit in a size_t (2^64 on a 64-bit machin e).
19 var largeTime = 1e300;
20
21 var audit = Audit.createTaskRunner();
22
23 // See crbug.com/582701. Create an audioparam with a huge end time and ve rify 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.
24 // automation is run. We don't care about the actual results, just that i t runs.
25
26 // 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
27 audit.defineTask("linearRamp", function (done) {
28 var graph = createGraph();
29 graph.gain.gain.linearRampToValueAtTime(0.1, largeTime);
30
31 graph.source.start();
32 graph.context.startRendering().then(function (buffer) {
33 testPassed("linearRampToValue(0.1, " + largeTime + ") successfully ren dered.");
34 }).then(done);
35 });
36
37 // Test exponential ramp with huge end time
38 audit.defineTask("exponentialRamp", function (done) {
39 var graph = createGraph();
40 graph.gain.gain.exponentialRampToValueAtTime(.1, largeTime);
41
42 graph.source.start();
43 graph.context.startRendering().then(function (buffer) {
44 testPassed("exponentialRampToValue(0.1, " + largeTime + ") successfull y rendered.");
45 }).then(done);
46 });
47
48 audit.defineTask("finish", function (done) {
49 finishJSTest();
50 done();
51 });
52
53 audit.runTasks();
54
55 // Create the graph and return the context, the source, and the gain node.
56 function createGraph() {
57 var context = new OfflineAudioContext(1, renderDuration * sampleRate, sa mpleRate);
58 var src = context.createBufferSource();
59 src.buffer = createConstantBuffer(context, 1, 1);
60 src.loop = true;
61 var gain = context.createGain();
62 src.connect(gain);
63 gain.connect(context.destination);
64 gain.gain.setValueAtTime(1, 0.1 / sampleRate);
65
66 return {
67 context: context,
68 gain: gain,
69 source: src
70 };
71 }
72
73 </script>
74 </body>
75 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webaudio/audioparam-large-endtime-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698