| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 description("Test if various kinds of MIDI messages can be validated."); | 9 description("Test if various kinds of MIDI messages can be validated."); |
| 10 | 10 |
| 11 shouldBeDefined("testRunner.setMIDISysexPermission"); | 11 shouldBeDefined("testRunner.setMIDISysexPermission"); |
| 12 shouldBeDefined("navigator.requestMIDIAccess"); | 12 shouldBeDefined("navigator.requestMIDIAccess"); |
| 13 | 13 |
| 14 window.jsTestIsAsync = true; | 14 window.jsTestIsAsync = true; |
| 15 | 15 |
| 16 testRunner.setMIDISysexPermission(true); | 16 testRunner.setMIDISysexPermission(true); |
| 17 | 17 |
| 18 navigator.requestMIDIAccess({sysex: true}).then(function (a) { | 18 navigator.requestMIDIAccess({sysex: true}).then(function (a) { |
| 19 output = a.outputs()[0]; | 19 output = a.outputs[Symbol.iterator]().next().value; |
| 20 | 20 |
| 21 // Note on(off). | 21 // Note on(off). |
| 22 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); | 22 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); |
| 23 | 23 |
| 24 // Running status is not allowed in Web MIDI API. | 24 // Running status is not allowed in Web MIDI API. |
| 25 shouldThrow('output.send([0x00, 0x01])'); | 25 shouldThrow('output.send([0x00, 0x01])'); |
| 26 | 26 |
| 27 // Unexpected End of Sysex. | 27 // Unexpected End of Sysex. |
| 28 shouldThrow('output.send([0xf7])'); | 28 shouldThrow('output.send([0xf7])'); |
| 29 | 29 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 shouldThrow('output.send([0xf0, 0xff, 0xf4, 0xf7])'); | 92 shouldThrow('output.send([0xf0, 0xff, 0xf4, 0xf7])'); |
| 93 | 93 |
| 94 finishJSTest(); | 94 finishJSTest(); |
| 95 }, function () { | 95 }, function () { |
| 96 testFailed("requestMIDIAccess() return an error."); | 96 testFailed("requestMIDIAccess() return an error."); |
| 97 }); | 97 }); |
| 98 | 98 |
| 99 </script> | 99 </script> |
| 100 </body> | 100 </body> |
| 101 </html> | 101 </html> |
| OLD | NEW |