| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test Constructor: ChannelMerger</title> | 4 <title>Test Constructor: ChannelMerger</title> |
| 5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
| 8 <script src="../resources/audio-testing.js"></script> | 8 <script src="../resources/audio-testing.js"></script> |
| 9 <script src="audionodeoptions.js"></script> | 9 <script src="audionodeoptions.js"></script> |
| 10 </head> | 10 </head> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 "correctly threw errors", | 42 "correctly threw errors", |
| 43 "did not throw errors in all cases"); | 43 "did not throw errors in all cases"); |
| 44 | 44 |
| 45 taskDone(); | 45 taskDone(); |
| 46 }); | 46 }); |
| 47 | 47 |
| 48 audit.defineTask("default constructor", function (taskDone) { | 48 audit.defineTask("default constructor", function (taskDone) { |
| 49 var node; | 49 var node; |
| 50 var success = true; | 50 var success = true; |
| 51 | 51 |
| 52 success = Should("node = new ChannelMergerNode(context)", function () { | 52 success = Should("node0 = new ChannelMergerNode(context)", function () { |
| 53 node = new ChannelMergerNode(context); | 53 node = new ChannelMergerNode(context); |
| 54 }).notThrow(); | 54 }).notThrow(); |
| 55 success = Should("node instanceof ChannelMergerNode", node instanceof Ch
annelMergerNode) | 55 success = Should("node0 instanceof ChannelMergerNode", node instanceof C
hannelMergerNode) |
| 56 .beEqualTo(true) && success; | 56 .beEqualTo(true) && success; |
| 57 | 57 |
| 58 success = Should("node.numberOfInputs", node.numberOfInputs) | 58 success = Should("node0.numberOfInputs", node.numberOfInputs) |
| 59 .beEqualTo(6) && success; | 59 .beEqualTo(6) && success; |
| 60 success = Should("node.numberOfOutputs", node.numberOfOutputs) | 60 success = Should("node0.numberOfOutputs", node.numberOfOutputs) |
| 61 .beEqualTo(1) && success; | 61 .beEqualTo(1) && success; |
| 62 success = Should("node.channelCount", node.channelCount) | 62 success = Should("node0.channelCount", node.channelCount) |
| 63 .beEqualTo(1) && success; | 63 .beEqualTo(1) && success; |
| 64 success = Should("node.channelCountMode", node.channelCountMode) | 64 success = Should("node0.channelCountMode", node.channelCountMode) |
| 65 .beEqualTo("explicit") && success; | 65 .beEqualTo("explicit") && success; |
| 66 success = Should("node.channelInterpretation", node.channelInterpretatio
n) | 66 success = Should("node0.channelInterpretation", node.channelInterpretati
on) |
| 67 .beEqualTo("speakers") && success; | 67 .beEqualTo("speakers") && success; |
| 68 | 68 |
| 69 Should("new ChannelMergerNode(context)", success) | 69 Should("new ChannelMergerNode(context)", success) |
| 70 .summarize( | 70 .summarize( |
| 71 "constructed node with correct attributes", | 71 "constructed node with correct attributes", |
| 72 "did not construct correct node correctly") | 72 "did not construct correct node correctly") |
| 73 | 73 |
| 74 taskDone(); | 74 taskDone(); |
| 75 }); | 75 }); |
| 76 | 76 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 92 | 92 |
| 93 audit.defineTask("constructor options", function (taskDone) { | 93 audit.defineTask("constructor options", function (taskDone) { |
| 94 var node; | 94 var node; |
| 95 var success = true; | 95 var success = true; |
| 96 var options = { | 96 var options = { |
| 97 numberOfInputs: 3, | 97 numberOfInputs: 3, |
| 98 numberOfOutputs: 9, | 98 numberOfOutputs: 9, |
| 99 channelInterpretation: "discrete" | 99 channelInterpretation: "discrete" |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 success = Should("node = new ChannelMergerNode(context, " + JSON.stringi
fy(options) + | 102 success = Should("node1 = new ChannelMergerNode(context, " + JSON.string
ify(options) + |
| 103 ")", | 103 ")", |
| 104 function () { | 104 function () { |
| 105 node = new ChannelMergerNode(context, options); | 105 node = new ChannelMergerNode(context, options); |
| 106 }).notThrow(); | 106 }).notThrow(); |
| 107 | 107 |
| 108 success = Should("node.numberOfInputs", node.numberOfInputs) | 108 success = Should("node1.numberOfInputs", node.numberOfInputs) |
| 109 .beEqualTo(options.numberOfInputs) && success; | 109 .beEqualTo(options.numberOfInputs) && success; |
| 110 success = Should("node.numberOfOutputs", node.numberOfOutputs) | 110 success = Should("node1.numberOfOutputs", node.numberOfOutputs) |
| 111 .beEqualTo(1) && success; | 111 .beEqualTo(1) && success; |
| 112 success = Should("node.channelInterpretation", node.channelInterpretatio
n) | 112 success = Should("node1.channelInterpretation", node.channelInterpretati
on) |
| 113 .beEqualTo(options.channelInterpretation) && success; | 113 .beEqualTo(options.channelInterpretation) && success; |
| 114 | 114 |
| 115 options = { | 115 options = { |
| 116 numberOfInputs: 99 | 116 numberOfInputs: 99 |
| 117 }; | 117 }; |
| 118 success = Should("new ChannelMergerNode(c, " + JSON.stringify(options) +
")", | 118 success = Should("new ChannelMergerNode(c, " + JSON.stringify(options) +
")", |
| 119 function () { | 119 function () { |
| 120 node = new ChannelMergerNode(context, options); | 120 node = new ChannelMergerNode(context, options); |
| 121 }) | 121 }) |
| 122 .throw("IndexSizeError") && success; | 122 .throw("IndexSizeError") && success; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 144 "constructed with correct attributes", | 144 "constructed with correct attributes", |
| 145 "was not constructed correctly"); | 145 "was not constructed correctly"); |
| 146 | 146 |
| 147 taskDone(); | 147 taskDone(); |
| 148 }); | 148 }); |
| 149 | 149 |
| 150 audit.runTasks(); | 150 audit.runTasks(); |
| 151 </script> | 151 </script> |
| 152 </body> | 152 </body> |
| 153 </html> | 153 </html> |
| OLD | NEW |