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