OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script src="state-check-utils.js"></script> |
| 6 </head> |
| 7 <body> |
| 8 <script> |
| 9 description("Tests MIDIPort implicit open."); |
| 10 |
| 11 function successAccessCallback(a) { |
| 12 window.access = a; |
| 13 testPassed("requestMIDIAccess() succeeded with access " + access + "."); |
| 14 |
| 15 checkStateTransition.bind(undefined, { |
| 16 port: access.inputs.values().next().value, |
| 17 method: "setonmidimessage", |
| 18 initialconnection: "closed", |
| 19 finalconnection: "open", |
| 20 })().then(checkStateTransition.bind(undefined, { |
| 21 port: access.outputs.values().next().value, |
| 22 method: "send", |
| 23 initialconnection: "closed", |
| 24 finalconnection: "open", |
| 25 })).then(finishJSTest, finishJSTest); |
| 26 } |
| 27 |
| 28 function errorAccessCallback(error) { |
| 29 testFailed("requestMIDIAccess() error callback should not be called when req
uesting basic access."); |
| 30 finishJSTest(); |
| 31 } |
| 32 |
| 33 window.jsTestIsAsync = true; |
| 34 |
| 35 // Test MIDIPort state transition by send() and onmidimessage handler. |
| 36 navigator.requestMIDIAccess().then(successAccessCallback, errorAccessCallback); |
| 37 |
| 38 </script> |
| 39 </body> |
| 40 </html> |
OLD | NEW |