WebProcessCache should keep track of processes being added
[WebKit-https.git] / LayoutTests / webaudio / audioparam-linearRampToValueAtTime.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html>
3 <head>
4 <script src="resources/audio-testing.js"></script>
5 <script src="resources/audioparam-testing.js"></script>
6 <script src="../resources/js-test-pre.js"></script>
7 </head>
8
9 <body>
10 <div id="description"></div>
11 <div id="console"></div>
12
13 <script>
14 description("Test AudioParam linearRampToValueAtTime() functionality.");
15
16 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime() and
17 // linearRampToValueAtTime() at regular intervals to set the starting and ending values for a
18 // linear ramp. Each time interval has a ramp with a different starting and ending value so
19 // that there is a discontinuity at each time interval boundary.  The discontinuity is for
20 // testing timing.  Also, we alternate between an increasing and decreasing ramp for each
21 // interval.
22
23 // Number of tests to run.
24 var numberOfTests = 100;
25
26 // Max allowed difference between the rendered data and the expected result.
27 var maxAllowedError = 6.5e-7;
28
29 // Set the gain node value to the specified value at the specified time.
30 function setValue(value, time)
31 {
32     gainNode.gain.setValueAtTime(value, time);
33 }
34
35 // Generate a linear ramp ending at time |endTime| with an ending value of |value|.
36 function generateRamp(value, startTime, endTime)
37 {
38     // |startTime| is ignored because the linear ramp uses the value from the setValueAtTime() call above.
39     gainNode.gain.linearRampToValueAtTime(value, endTime)
40 }
41
42 function runTest()
43 {
44     createAudioGraphAndTest(numberOfTests,
45                             1,
46                             setValue,
47                             generateRamp,
48                             "linearRampToValueAtTime()",
49                             maxAllowedError,
50                             createLinearRampArray);
51 }
52
53 runTest();
54 successfullyParsed = true;
55   
56 </script>
57
58 <script src="../resources/js-test-post.js"></script>
59 </body>
60 </html>