| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <title>Test Constructor: Oscillator</title> | 4 <title>Test Constructor: Oscillator</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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 success = Should("node1.channelInterpretation", node.channelInterpretati
on) | 110 success = Should("node1.channelInterpretation", node.channelInterpretati
on) |
| 111 .beEqualTo("speakers") && success; | 111 .beEqualTo("speakers") && success; |
| 112 | 112 |
| 113 // Test that type and periodicWave options work as described. | 113 // Test that type and periodicWave options work as described. |
| 114 options = { | 114 options = { |
| 115 type: "sine", | 115 type: "sine", |
| 116 periodicWave: new PeriodicWave(context, { | 116 periodicWave: new PeriodicWave(context, { |
| 117 real: [1, 1] | 117 real: [1, 1] |
| 118 }) | 118 }) |
| 119 }; | 119 }; |
| 120 success = Should("new OscillatorNode(c, " + JSON.stringify(options) + ")
", | 120 success = Should("node2 = new OscillatorNode(c, " + JSON.stringify(optio
ns) + ")", |
| 121 function () { | 121 function () { |
| 122 node = new OscillatorNode(context, options); | 122 node = new OscillatorNode(context, options); |
| 123 }) | 123 }) |
| 124 .throw("InvalidStateError") && success; | 124 .notThrow() && success; |
| 125 Should("node2.type", node.type).beEqualTo("custom"); |
| 125 | 126 |
| 126 options = { | 127 options = { |
| 127 type: "custom" | 128 type: "custom" |
| 128 }; | 129 }; |
| 129 success = Should("new OscillatorNode(c, " + JSON.stringify(options) + ")
", | 130 success = Should("new OscillatorNode(c, " + JSON.stringify(options) + ")
", |
| 130 function () { | 131 function () { |
| 131 node = new OscillatorNode(context, options); | 132 node = new OscillatorNode(context, options); |
| 132 }) | 133 }) |
| 133 .throw("InvalidStateError") && success; | 134 .throw("InvalidStateError") && success; |
| 134 | 135 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 149 "constructed with correct attributes", | 150 "constructed with correct attributes", |
| 150 "was not constructed correctly"); | 151 "was not constructed correctly"); |
| 151 | 152 |
| 152 taskDone(); | 153 taskDone(); |
| 153 }); | 154 }); |
| 154 | 155 |
| 155 audit.runTasks(); | 156 audit.runTasks(); |
| 156 </script> | 157 </script> |
| 157 </body> | 158 </body> |
| 158 </html> | 159 </html> |
| OLD | NEW |