WebProcessCache should keep track of processes being added
[WebKit-https.git] / LayoutTests / webaudio / audioparam-setValueAtTime.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 setValueAtTime() functionality.");
15
16 // Play a long DC signal out through an AudioGainNode, and call setValueAtTime() at regular
17 // intervals to set the value for the duration of the interval.  Each time interval has
18 // different value so that there is a discontinuity at each time interval boundary.  The
19 // discontinuity is for testing timing.
20
21 // Number of tests to run.
22 var numberOfTests = 100;
23
24 // Max allowed difference between the rendered data and the expected result.
25 var maxAllowedError = 6e-8;
26
27 // Set the gain node value to the specified value at the specified time.
28 function setValue(value, time)
29 {
30     gainNode.gain.setValueAtTime(value, time);
31 }
32
33 // For testing setValueAtTime(), we don't need to do anything for automation. because the value at
34 // the beginning of the interval is set by setValue and it remains constant for the duration, which
35 // is what we want.
36 function automation(value, startTime, endTime)
37 {
38     // Do nothing.
39 }
40
41 function runTest()
42 {
43     createAudioGraphAndTest(numberOfTests,
44                             1,
45                             setValue,
46                             automation,
47                             "setValueAtTime()",
48                             maxAllowedError,
49                             createConstantArray);
50 }
51
52 runTest();
53 successfullyParsed = true;
54
55 </script>
56
57 <script src="../resources/js-test-post.js"></script>
58 </body>
59 </html>