OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../resources/testharness.js"></script> | 4 <script src="../../resources/testharness.js"></script> |
5 <script src="../../resources/testharnessreport.js"></script> | 5 <script src="../../resources/testharnessreport.js"></script> |
6 <script src="../resources/audit-util.js"></script> | 6 <script src="../resources/audit-util.js"></script> |
7 <script src="../resources/audit.js"></script> | 7 <script src="../resources/audit.js"></script> |
8 <title>Handle Silent Inputs to AnalyserNode</title> | 8 <title>Handle Silent Inputs to AnalyserNode</title> |
9 </head> | 9 </head> |
10 | 10 |
11 <body> | 11 <body> |
12 <script> | 12 <script> |
13 let audit = Audit.createTaskRunner(); | 13 let audit = Audit.createTaskRunner(); |
14 let sampleRate = 16000; | 14 let sampleRate = 16000; |
15 let renderDuration = 1; | 15 let renderDuration = 1; |
16 let renderFrames = renderDuration * sampleRate; | 16 let renderFrames = renderDuration * sampleRate; |
17 | 17 |
18 audit.define('connected', function(task, should) { | 18 audit.define({ |
19 task.describe('Test handling of silent inputs'); | 19 label: 'connected', |
20 | 20 description: 'Test handling of silent inputs' |
| 21 }, function (task, should) { |
21 tester(should, false).then(task.done.bind(task)); | 22 tester(should, false).then(task.done.bind(task)); |
22 }); | 23 }); |
23 | 24 |
24 audit.define('auto-pull', function(task, should) { | 25 audit.define({ |
25 task.describe('Test handling of silent inputs'); | 26 label: 'auto-pull', |
26 | 27 description: 'Test handling of silent inputs' |
| 28 }, function(task, should) { |
27 tester(should, true).then(task.done.bind(task)); | 29 tester(should, true).then(task.done.bind(task)); |
28 }); | 30 }); |
29 | 31 |
30 audit.define('timing', function(task, should) { | 32 audit.define({ |
31 task.describe('Test shifting in of zeroes after source has stopped'); | 33 label: 'timing', |
32 | 34 description: 'Test shifting in of zeroes after source has stopped' |
| 35 }, function(task, should) { |
33 let renderQuantumFrames = 128; | 36 let renderQuantumFrames = 128; |
34 | 37 |
35 // sampleRate chosen to be a power of two so we don't have round-off | 38 // sampleRate chosen to be a power of two so we don't have round-off |
36 // errors in computing the times for when to suspend the context. | 39 // errors in computing the times for when to suspend the context. |
37 let context = new OfflineAudioContext(1, 16384, 16384); | 40 let context = new OfflineAudioContext(1, 16384, 16384); |
38 let source = new ConstantSourceNode(context); | 41 let source = new ConstantSourceNode(context); |
39 | 42 |
40 // The fftSize for the analyser is fairly arbitrary, except the code | 43 // The fftSize for the analyser is fairly arbitrary, except the code |
41 // assumes it is larger than 128. | 44 // assumes it is larger than 128. |
42 let analyser = new AnalyserNode(context, {fftSize: 2048}); | 45 let analyser = new AnalyserNode(context, {fftSize: 2048}); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 .then(context.resume.bind(context)); | 131 .then(context.resume.bind(context)); |
129 | 132 |
130 return context.startRendering().then(buffer => { | 133 return context.startRendering().then(buffer => { |
131 should(timeData, 'Analyser time data at time ' + dataTime) | 134 should(timeData, 'Analyser time data at time ' + dataTime) |
132 .beConstantValueOf(0); | 135 .beConstantValueOf(0); |
133 }); | 136 }); |
134 } | 137 } |
135 </script> | 138 </script> |
136 </body> | 139 </body> |
137 </html> | 140 </html> |
OLD | NEW |