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.setPermission"); | 11 shouldBeDefined("testRunner.setPermission"); |
12 shouldBeDefined("testRunner.setMIDISysexPermission"); | |
13 shouldBeDefined("navigator.requestMIDIAccess"); | 12 shouldBeDefined("navigator.requestMIDIAccess"); |
14 | 13 |
15 window.jsTestIsAsync = true; | 14 window.jsTestIsAsync = true; |
16 | 15 |
17 testRunner.setPermission('midi-sysex', 'granted', location.origin, location.orig
in); | 16 testRunner.setPermission('midi-sysex', 'granted', location.origin, location.orig
in); |
18 testRunner.setMIDISysexPermission(true); | |
19 | 17 |
20 navigator.requestMIDIAccess({sysex: true}).then(function (a) { | 18 navigator.requestMIDIAccess({sysex: true}).then(function (a) { |
21 output = a.outputs.values().next().value; | 19 output = a.outputs.values().next().value; |
22 | 20 |
23 // Note on(off). | 21 // Note on(off). |
24 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); | 22 output.send([0xff, 0x90, 0x00, 0x00, 0x90, 0x07, 0x00]); |
25 | 23 |
26 // Running status is not allowed in Web MIDI API. | 24 // Running status is not allowed in Web MIDI API. |
27 shouldThrow('output.send([0x00, 0x01])'); | 25 shouldThrow('output.send([0x00, 0x01])'); |
28 | 26 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 shouldThrow('output.send(new Uint8Array(), Infinity)'); | 98 shouldThrow('output.send(new Uint8Array(), Infinity)'); |
101 | 99 |
102 finishJSTest(); | 100 finishJSTest(); |
103 }, function () { | 101 }, function () { |
104 testFailed("requestMIDIAccess() return an error."); | 102 testFailed("requestMIDIAccess() return an error."); |
105 }); | 103 }); |
106 | 104 |
107 </script> | 105 </script> |
108 </body> | 106 </body> |
109 </html> | 107 </html> |
OLD | NEW |