OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test Constructor: StereoPanner</title> | 4 <title> |
| 5 Test Constructor: StereoPanner |
| 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, 'StereoPannerNode', context); | 25 testInvalidConstructor(should, 'StereoPannerNode', context); |
25 task.done(); | 26 task.done(); |
26 }); | 27 }); |
(...skipping 10 matching lines...) Expand all Loading... |
37 }); | 38 }); |
38 | 39 |
39 testDefaultAttributes(should, node, prefix, [{name: 'pan', value: 0}]); | 40 testDefaultAttributes(should, node, prefix, [{name: 'pan', value: 0}]); |
40 | 41 |
41 task.done(); | 42 task.done(); |
42 }); | 43 }); |
43 | 44 |
44 audit.define('test AudioNodeOptions', (task, should) => { | 45 audit.define('test AudioNodeOptions', (task, should) => { |
45 // Can't use testAudioNodeOptions because the constraints for this node | 46 // Can't use testAudioNodeOptions because the constraints for this node |
46 // are not supported there. | 47 // are not supported there. |
47 var node; | 48 let node; |
48 | 49 |
49 // Test that we can set the channel count to 1 or 2. | 50 // Test that we can set the channel count to 1 or 2. |
50 var options = {channelCount: 1}; | 51 let options = {channelCount: 1}; |
51 should( | 52 should( |
52 () => { | 53 () => { |
53 node = new StereoPannerNode(context, options); | 54 node = new StereoPannerNode(context, options); |
54 }, | 55 }, |
55 'new StereoPannerNode(c, ' + JSON.stringify(options) + ')') | 56 'new StereoPannerNode(c, ' + JSON.stringify(options) + ')') |
56 .notThrow(); | 57 .notThrow(); |
57 should(node.channelCount, 'node.channelCount').beEqualTo(1); | 58 should(node.channelCount, 'node.channelCount').beEqualTo(1); |
58 | 59 |
59 options = {channelCount: 2}; | 60 options = {channelCount: 2}; |
60 should( | 61 should( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 () => { | 155 () => { |
155 node = new StereoPannerNode(context, options); | 156 node = new StereoPannerNode(context, options); |
156 }, | 157 }, |
157 'new StereoPannerNode(c, ' + JSON.stringify(options) + ')') | 158 'new StereoPannerNode(c, ' + JSON.stringify(options) + ')') |
158 .throw('TypeError'); | 159 .throw('TypeError'); |
159 | 160 |
160 task.done(); | 161 task.done(); |
161 }); | 162 }); |
162 | 163 |
163 audit.define('constructor with options', (task, should) => { | 164 audit.define('constructor with options', (task, should) => { |
164 var node; | 165 let node; |
165 var options = { | 166 let options = { |
166 pan: 0.75, | 167 pan: 0.75, |
167 }; | 168 }; |
168 | 169 |
169 should( | 170 should( |
170 () => { | 171 () => { |
171 node = new StereoPannerNode(context, options); | 172 node = new StereoPannerNode(context, options); |
172 }, | 173 }, |
173 'node1 = new StereoPannerNode(, ' + JSON.stringify(options) + ')') | 174 'node1 = new StereoPannerNode(, ' + JSON.stringify(options) + ')') |
174 .notThrow(); | 175 .notThrow(); |
175 should( | 176 should( |
176 node instanceof StereoPannerNode, | 177 node instanceof StereoPannerNode, |
177 'node1 instanceof StereoPannerNode') | 178 'node1 instanceof StereoPannerNode') |
178 .beEqualTo(true); | 179 .beEqualTo(true); |
179 | 180 |
180 should(node.pan.value, 'node1.pan.value').beEqualTo(options.pan); | 181 should(node.pan.value, 'node1.pan.value').beEqualTo(options.pan); |
181 | 182 |
182 task.done(); | 183 task.done(); |
183 }); | 184 }); |
184 | 185 |
185 audit.run(); | 186 audit.run(); |
186 </script> | 187 </script> |
187 </body> | 188 </body> |
188 </html> | 189 </html> |
OLD | NEW |