OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test Constructor: Panner</title> | 4 <title> |
| 5 Test Constructor: Panner |
| 6 </title> |
5 <script src="../../resources/testharness.js"></script> | 7 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 8 <script src="../../resources/testharnessreport.js"></script> |
7 <script src="../resources/audit-util.js"></script> | 9 <script src="../resources/audit-util.js"></script> |
8 <script src="../resources/audit.js"></script> | 10 <script src="../resources/audit.js"></script> |
9 <script src="audionodeoptions.js"></script> | 11 <script src="audionodeoptions.js"></script> |
10 </head> | 12 </head> |
| 13 <body> |
| 14 <script id="layout-test-code"> |
| 15 let context; |
11 | 16 |
12 <body> | 17 let audit = Audit.createTaskRunner(); |
13 <script> | |
14 var context; | |
15 | |
16 var audit = Audit.createTaskRunner(); | |
17 | 18 |
18 audit.define('initialize', (task, should) => { | 19 audit.define('initialize', (task, should) => { |
19 context = initializeContext(should); | 20 context = initializeContext(should); |
20 task.done(); | 21 task.done(); |
21 }); | 22 }); |
22 | 23 |
23 audit.define('invalid constructor', (task, should) => { | 24 audit.define('invalid constructor', (task, should) => { |
24 testInvalidConstructor(should, 'PannerNode', context); | 25 testInvalidConstructor(should, 'PannerNode', context); |
25 task.done(); | 26 task.done(); |
26 }); | 27 }); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 'context.listener.' + item.name + '.value') | 69 'context.listener.' + item.name + '.value') |
69 .beEqualTo(item.value); | 70 .beEqualTo(item.value); |
70 }); | 71 }); |
71 | 72 |
72 task.done(); | 73 task.done(); |
73 }); | 74 }); |
74 | 75 |
75 audit.define('test AudioNodeOptions', (task, should) => { | 76 audit.define('test AudioNodeOptions', (task, should) => { |
76 // Can't use testAudioNodeOptions because the constraints for this node | 77 // Can't use testAudioNodeOptions because the constraints for this node |
77 // are not supported there. | 78 // are not supported there. |
78 var node; | 79 let node; |
79 var success = true; | 80 let success = true; |
80 | 81 |
81 // Test that we can set the channel count to 1 or 2. | 82 // Test that we can set the channel count to 1 or 2. |
82 var options = {channelCount: 1}; | 83 let options = {channelCount: 1}; |
83 should( | 84 should( |
84 () => { | 85 () => { |
85 node = new PannerNode(context, options); | 86 node = new PannerNode(context, options); |
86 }, | 87 }, |
87 'node1 = new PannerNode(c, ' + JSON.stringify(options) + ')') | 88 'node1 = new PannerNode(c, ' + JSON.stringify(options) + ')') |
88 .notThrow(); | 89 .notThrow(); |
89 should(node.channelCount, 'node1.channelCount') | 90 should(node.channelCount, 'node1.channelCount') |
90 .beEqualTo(options.channelCount); | 91 .beEqualTo(options.channelCount); |
91 | 92 |
92 options = {channelCount: 2}; | 93 options = {channelCount: 2}; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 () => { | 189 () => { |
189 node = new PannerNode(context, options); | 190 node = new PannerNode(context, options); |
190 }, | 191 }, |
191 'new PannerNode(c, ' + JSON.stringify(options) + ')') | 192 'new PannerNode(c, ' + JSON.stringify(options) + ')') |
192 .throw('TypeError'); | 193 .throw('TypeError'); |
193 | 194 |
194 task.done(); | 195 task.done(); |
195 }); | 196 }); |
196 | 197 |
197 audit.define('constructor with options', (task, should) => { | 198 audit.define('constructor with options', (task, should) => { |
198 var node; | 199 let node; |
199 var success = true; | 200 let success = true; |
200 var options = { | 201 let options = { |
201 panningModel: 'HRTF', | 202 panningModel: 'HRTF', |
202 // We use full double float values here to verify also that the actual | 203 // We use full double float values here to verify also that the actual |
203 // AudioParam value is properly rounded to a float. The actual value | 204 // AudioParam value is properly rounded to a float. The actual value |
204 // is immaterial as long as x != Math.fround(x). | 205 // is immaterial as long as x != Math.fround(x). |
205 positionX: Math.SQRT2, | 206 positionX: Math.SQRT2, |
206 positionY: 2 * Math.SQRT2, | 207 positionY: 2 * Math.SQRT2, |
207 positionZ: 3 * Math.SQRT2, | 208 positionZ: 3 * Math.SQRT2, |
208 orientationX: -Math.SQRT2, | 209 orientationX: -Math.SQRT2, |
209 orientationY: -2 * Math.SQRT2, | 210 orientationY: -2 * Math.SQRT2, |
210 orientationZ: -3 * Math.SQRT2, | 211 orientationZ: -3 * Math.SQRT2, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 should(node.channelInterpretation, 'node.channelInterpretation') | 265 should(node.channelInterpretation, 'node.channelInterpretation') |
265 .beEqualTo('speakers'); | 266 .beEqualTo('speakers'); |
266 | 267 |
267 task.done(); | 268 task.done(); |
268 }); | 269 }); |
269 | 270 |
270 audit.run(); | 271 audit.run(); |
271 </script> | 272 </script> |
272 </body> | 273 </body> |
273 </html> | 274 </html> |
OLD | NEW |