Chromium Code Reviews| 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, | |
|
hongchan
2017/02/24 23:18:04
Is this what clang-format does?
I actually prefer
Raymond Toy
2017/02/24 23:24:30
Yes. Maybe adding { } will change the layout?
Raymond Toy
2017/02/24 23:28:42
Nope. We get
should(
() => {medi
hongchan
2017/02/24 23:34:26
Then at least we should add a space after/before c
Raymond Toy
2017/02/24 23:48:02
I originally started with
() => {
media = 9
hongchan
2017/02/27 18:00:54
Acknowledged.
| |
| 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 // FIXME: We should have no outputs, but since we're implemented using |
| 30 shouldBe('mediaStreamDestination.__proto__.__proto__', 'AudioNode.prototype' ); | 44 // AudioBasicInspectorNode |
| 45 // we have one. | |
| 46 // if (mediaStreamDestination.numberOfOutputs == 0) | |
| 47 // testPassed("Destination AudioNode has no outputs."); | |
| 48 // else | |
| 49 // testFailed("Destination AudioNode should not have outputs."); | |
| 31 | 50 |
| 32 // Check the channel count boundary of 8. | 51 // FIXME: add a test where we create a PeerConnection and call |
| 33 Should('Setting the channel count beyond 8', function () { | 52 // addStream(mediaStreamDestination.stream). |
|
hongchan
2017/02/24 23:18:04
Do we still need this commented out section?
Raymond Toy
2017/02/24 23:24:30
This addStream part? We should probably test that
hongchan
2017/02/24 23:34:26
I meant between the line 43 ~ 52.
Raymond Toy
2017/02/24 23:48:02
I think we should just make it test that we have o
hongchan
2017/02/27 18:00:54
Acknowledged.
| |
| 34 mediaStreamDestination.channelCount = 9; | |
| 35 }).throw('NotSupportedError'); | |
| 36 | 53 |
| 37 // Check number of inputs and outputs. | 54 task.done(); |
| 38 if (mediaStreamDestination.numberOfInputs == 1) | 55 }); |
| 39 testPassed("Destination AudioNode has one input."); | |
| 40 else | |
| 41 testFailed("Destination AudioNode should have one input."); | |
| 42 | 56 |
| 43 // FIXME: We should have no outputs, but since we're implemented using Audio BasicInspectorNode | 57 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> | 58 </script> |
| 59 | 59 |
| 60 </body> | 60 </body> |
| 61 </html> | 61 </html> |
| OLD | NEW |