OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <script> |
| 8 description("Tests the legacy MIDI port API support."); |
| 9 |
| 10 window.jsTestIsAsync = true; |
| 11 |
| 12 navigator.requestMIDIAccess().then(function(access) { |
| 13 window.access = access; |
| 14 shouldBeEqualToString('typeof(access.inputs)', 'function'); |
| 15 shouldBeEqualToString('typeof(access.outputs)', 'function'); |
| 16 |
| 17 window.inputs = access.inputs(); |
| 18 shouldBe('inputs.length', '1'); |
| 19 shouldBeEqualToString("inputs[0].id", "MockInputID"); |
| 20 shouldBeEqualToString("inputs[0].manufacturer", "MockInputManufacturer"); |
| 21 shouldBeEqualToString("inputs[0].name", "MockInputName"); |
| 22 shouldBeEqualToString("inputs[0].version", "MockInputVersion"); |
| 23 |
| 24 window.outputs = access.outputs(); |
| 25 shouldBeEqualToString("outputs[0].id", "MockOutputID"); |
| 26 shouldBeEqualToString("outputs[0].manufacturer", "MockOutputManufacturer"); |
| 27 shouldBeEqualToString("outputs[0].name", "MockOutputName"); |
| 28 shouldBeEqualToString("outputs[0].version", "MockOutputVersion"); |
| 29 }).catch(function(e) { |
| 30 testFailed('e: ' + e); |
| 31 }).then(finishJSTest, finishJSTest); |
| 32 |
| 33 </script> |
| 34 </body> |
| 35 </html> |
OLD | NEW |