OLD | NEW |
1 <!doctype html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Test Constructor: Gain</title> | 4 <title> |
| 5 Test Constructor: Gain |
| 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, 'GainNode', context); | 25 testInvalidConstructor(should, 'GainNode', context); |
25 task.done(); | 26 task.done(); |
26 }); | 27 }); |
(...skipping 13 matching lines...) Expand all Loading... |
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 testAudioNodeOptions(should, context, 'GainNode'); | 46 testAudioNodeOptions(should, context, 'GainNode'); |
46 task.done(); | 47 task.done(); |
47 }); | 48 }); |
48 | 49 |
49 audit.define('constructor with options', (task, should) => { | 50 audit.define('constructor with options', (task, should) => { |
50 var node; | 51 let node; |
51 var options = { | 52 let options = { |
52 gain: -2, | 53 gain: -2, |
53 }; | 54 }; |
54 | 55 |
55 should( | 56 should( |
56 () => { | 57 () => { |
57 node = new GainNode(context, options); | 58 node = new GainNode(context, options); |
58 }, | 59 }, |
59 'node1 = new GainNode(c, ' + JSON.stringify(options) + ')') | 60 'node1 = new GainNode(c, ' + JSON.stringify(options) + ')') |
60 .notThrow(); | 61 .notThrow(); |
61 should(node instanceof GainNode, 'node1 instanceof GainNode') | 62 should(node instanceof GainNode, 'node1 instanceof GainNode') |
62 .beEqualTo(true); | 63 .beEqualTo(true); |
63 | 64 |
64 should(node.gain.value, 'node1.gain.value').beEqualTo(options.gain); | 65 should(node.gain.value, 'node1.gain.value').beEqualTo(options.gain); |
65 | 66 |
66 should(node.channelCount, 'node1.channelCount').beEqualTo(2); | 67 should(node.channelCount, 'node1.channelCount').beEqualTo(2); |
67 should(node.channelCountMode, 'node1.channelCountMode') | 68 should(node.channelCountMode, 'node1.channelCountMode') |
68 .beEqualTo('max'); | 69 .beEqualTo('max'); |
69 should(node.channelInterpretation, 'node1.channelInterpretation') | 70 should(node.channelInterpretation, 'node1.channelInterpretation') |
70 .beEqualTo('speakers'); | 71 .beEqualTo('speakers'); |
71 | 72 |
72 task.done(); | 73 task.done(); |
73 }); | 74 }); |
74 | 75 |
75 audit.run(); | 76 audit.run(); |
76 </script> | 77 </script> |
77 </body> | 78 </body> |
78 </html> | 79 </html> |
OLD | NEW |