4 <script src=
"../resources/js-test.js"></script>
8 description("Tests navigator.requestMIDIAccess failure.");
10 function successCallback(access
) {
11 testFailed("requestMIDIAccess() does not fail unexpectedly.");
15 function errorCallback(error
) {
16 errorName
= error
.name
;
17 shouldBe("errorName", "'InvalidStateError'");
18 testPassed("requestMIDIAccess() fail as expected.");
22 window
.jsTestIsAsync
= true;
24 // set testRunner configuration so that requestMIDIAccess returns "InvalidStateError".
25 testRunner
.setMIDIAccessorResult(false);
26 navigator
.requestMIDIAccess().then(successCallback
, errorCallback
);