OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <script src="../../resources/js-test.js"></script> | 3 <script src="../../resources/js-test.js"></script> |
4 <body> | 4 <body> |
5 <script type="text/javascript"> | 5 <script type="text/javascript"> |
6 description("Test navigator.requestMIDIAccess API in WebView"); | 6 description("Test navigator.requestMIDIAccess API in WebView"); |
7 window.jsTestIsAsync = true; | 7 window.jsTestIsAsync = true; |
8 | 8 |
9 function onMIDIError(errorMessage) { | 9 function onMIDIError(errorMessage) { |
10 testFailed('requestMIDIAccess error callback, reason: ' + errorMessage); | 10 testFailed('requestMIDIAccess error callback, reason: ' + errorMessage); |
11 finishJSTest(); | 11 finishJSTest(); |
12 } | 12 } |
13 | 13 |
14 function onMIDISuccess(access) { | 14 function onMIDISuccess(access) { |
15 window.access = access; | 15 window.access = access; |
16 shouldBeTrue('access.sysexEnabled'); | 16 shouldBeTrue('access.sysexEnabled'); |
17 testPassed('requestMIDIAccess with option sysex:true succeeded.'); | 17 testPassed('requestMIDIAccess with option sysex:true succeeded.'); |
18 finishJSTest(); | 18 finishJSTest(); |
19 } | 19 } |
20 | 20 |
21 navigator.requestMIDIAccess({sysex:true}).then( | 21 navigator.requestMIDIAccess({sysex:true}).then( |
22 onMIDISuccess, onMIDIError); | 22 onMIDISuccess, onMIDIError); |
23 </script> | 23 </script> |
24 </body> | 24 </body> |
25 </html> | 25 </html> |
OLD | NEW |