| 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 <script src="../http/tests/resources/permissions-helper.js"></script> | 5 <script src="../http/tests/resources/permissions-helper.js"></script> |
| 6 </head> | 6 </head> |
| 7 <body> | 7 <body> |
| 8 <script> | 8 <script> |
| 9 | 9 |
| 10 description("Test if various kinds of MIDI messages can be validated."); | 10 description("Test if various kinds of MIDI messages can be validated."); |
| 11 | 11 |
| 12 shouldBeDefined("navigator.requestMIDIAccess"); | 12 shouldBeDefined("navigator.requestMIDIAccess"); |
| 13 | 13 |
| 14 window.jsTestIsAsync = true; | 14 window.jsTestIsAsync = true; |
| 15 | 15 |
| 16 Promise.all([PermissionsHelper.setPermission('midi', 'granted'), | 16 PermissionsHelper.setPermission('midi-sysex', 'granted').then(function() { |
| 17 PermissionsHelper.setPermission('midi-sysex', 'granted')]).then(fun
ction() { | |
| 18 return navigator.requestMIDIAccess({sysex: true}); | 17 return navigator.requestMIDIAccess({sysex: true}); |
| 19 }).then(function(a) { | 18 }).then(function(a) { |
| 20 output = a.outputs.values().next().value; | 19 output = a.outputs.values().next().value; |
| 21 | 20 |
| 22 // Note on(off). | 21 // Note on(off). |
| 23 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); | 22 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); |
| 24 | 23 |
| 25 // Running status is not allowed in Web MIDI API. | 24 // Running status is not allowed in Web MIDI API. |
| 26 shouldThrow('output.send([0x00, 0x01])'); | 25 shouldThrow('output.send([0x00, 0x01])'); |
| 27 | 26 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 99 |
| 101 finishJSTest(); | 100 finishJSTest(); |
| 102 }).catch(function () { | 101 }).catch(function () { |
| 103 testFailed("requestMIDIAccess() return an error."); | 102 testFailed("requestMIDIAccess() return an error."); |
| 104 finishJSTest(); | 103 finishJSTest(); |
| 105 }); | 104 }); |
| 106 | 105 |
| 107 </script> | 106 </script> |
| 108 </body> | 107 </body> |
| 109 </html> | 108 </html> |
| OLD | NEW |