OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 | 2 |
3 <html> | 3 <html> |
4 <head> | 4 <head> |
5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
6 <script src="../resources/audit-util.js"></script> | 7 <script src="../resources/audit-util.js"></script> |
7 <script src="../resources/audio-testing.js"></script> | 8 <script src="../resources/audit.js"></script> |
8 </head> | 9 </head> |
9 | 10 |
10 <body> | 11 <body> |
11 <div id="description"></div> | 12 <script> |
12 <div id="console"></div> | 13 let audit = Audit.createTaskRunner(); |
13 | 14 |
14 <script> | 15 audit.define( |
15 description("Basic tests for MediaStreamAudioDestinationNode API."); | 16 { |
| 17 label: 'test', |
| 18 description: 'Basic tests for MediaStreamAudioDestinationNode API' |
| 19 }, |
| 20 (task, should) => { |
| 21 let context = new AudioContext(); |
16 | 22 |
17 var context; | 23 let mediaStreamDestination = context.createMediaStreamDestination(); |
18 var mediaStreamDestination; | |
19 | 24 |
20 function runTest() { | 25 // MediaStreamAudioDestinationNode should inherit AudioNode. |
21 if (window.testRunner) { | 26 should( |
22 testRunner.dumpAsText(); | 27 mediaStreamDestination instanceof AudioNode, |
23 } | 28 'mediaStreamDestination instance') |
| 29 .beTrue(); |
24 | 30 |
25 context = new AudioContext(); | 31 // Check the channel count boundary of 8. |
| 32 should( |
| 33 () => mediaStreamDestination.channelCount = 9, |
| 34 'Setting the channel count beyond 8') |
| 35 .throw('NotSupportedError'); |
26 | 36 |
27 mediaStreamDestination = context.createMediaStreamDestination(); | 37 // Check number of inputs and outputs. |
| 38 should( |
| 39 mediaStreamDestination.numberOfInputs, |
| 40 'mediaStreamDestination.numberOfInputs') |
| 41 .beEqualTo(1); |
28 | 42 |
29 // MediaStreamAudioDestinationNode should inherit AudioNode. | 43 // We should have no outputs, but since we're implemented using |
30 shouldBe('mediaStreamDestination.__proto__.__proto__', 'AudioNode.prototype'
); | 44 // AudioBasicInspectorNode, we have one. |
| 45 should(mediaStreamDestination.numberOfOutputs, |
| 46 'Number of outputs') |
| 47 .beEqualTo(1); |
31 | 48 |
32 // Check the channel count boundary of 8. | 49 // FIXME: add a test where we create a PeerConnection and call |
33 Should('Setting the channel count beyond 8', function () { | 50 // addStream(mediaStreamDestination.stream). |
34 mediaStreamDestination.channelCount = 9; | |
35 }).throw('NotSupportedError'); | |
36 | 51 |
37 // Check number of inputs and outputs. | 52 task.done(); |
38 if (mediaStreamDestination.numberOfInputs == 1) | 53 }); |
39 testPassed("Destination AudioNode has one input."); | |
40 else | |
41 testFailed("Destination AudioNode should have one input."); | |
42 | 54 |
43 // FIXME: We should have no outputs, but since we're implemented using Audio
BasicInspectorNode | 55 audit.run(); |
44 // we have one. | |
45 // if (mediaStreamDestination.numberOfOutputs == 0) | |
46 // testPassed("Destination AudioNode has no outputs."); | |
47 // else | |
48 // testFailed("Destination AudioNode should not have outputs."); | |
49 | |
50 // FIXME: add a test where we create a PeerConnection and call addStream(med
iaStreamDestination.stream). | |
51 | |
52 finishJSTest(); | |
53 } | |
54 | |
55 runTest(); | |
56 window.successfullyParsed = true; | |
57 | |
58 </script> | 56 </script> |
59 | 57 |
60 </body> | 58 </body> |
61 </html> | 59 </html> |
OLD | NEW |