| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"> | |
| 5 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.js"></script> |
| 6 </head> | 5 </head> |
| 7 <body> | 6 <body> |
| 8 <script> | 7 <script> |
| 9 description("Tests navigator.requestMIDIAccess failure."); | 8 description("Tests navigator.requestMIDIAccess failure."); |
| 10 | 9 |
| 11 function successCallback(access) { | 10 function successCallback(access) { |
| 12 testFailed("requestMIDIAccess() does not fail unexpectedly."); | 11 testFailed("requestMIDIAccess() does not fail unexpectedly."); |
| 13 finishJSTest(); | 12 finishJSTest(); |
| 14 } | 13 } |
| 15 | 14 |
| 16 function errorCallback(error) { | 15 function errorCallback(error) { |
| 17 errorName = error.name; | 16 errorName = error.name; |
| 18 shouldBe("errorName", "'InvalidStateError'"); | 17 shouldBe("errorName", "'InvalidStateError'"); |
| 19 testPassed("requestMIDIAccess() fail as expected."); | 18 testPassed("requestMIDIAccess() fail as expected."); |
| 20 finishJSTest(); | 19 finishJSTest(); |
| 21 } | 20 } |
| 22 | 21 |
| 23 window.jsTestIsAsync = true; | 22 window.jsTestIsAsync = true; |
| 24 | 23 |
| 25 // set testRunner configuration so that requestMIDIAccess returns "InvalidStateE
rror". | 24 // set testRunner configuration so that requestMIDIAccess returns "InvalidStateE
rror". |
| 26 testRunner.setMIDIAccessorResult(false); | 25 testRunner.setMIDIAccessorResult(false); |
| 27 shouldNotThrow("navigator.requestMIDIAccess().then(successCallback, errorCallbac
k)"); | 26 shouldNotThrow("navigator.requestMIDIAccess().then(successCallback, errorCallbac
k)"); |
| 28 | 27 |
| 29 </script> | 28 </script> |
| 30 </body> | 29 </body> |
| 31 </html> | 30 </html> |
| OLD | NEW |