summaryrefslogtreecommitdiffstats
path: root/dom/midi/tests/test_midi_permission_prompt.html
blob: 26a6b3d7898dc6d93e06a1a911cc34517ec68224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<html>
  <head>
    <title>WebMIDI Listener Test</title>
    <script src="/tests/SimpleTest/SimpleTest.js"></script>
    <script type="application/javascript" src="MIDITestUtils.js"></script>
  </head>

  <body onload="runTests()">
    <script class="testbody" type="application/javascript">
     SimpleTest.waitForExplicitFinish();

     async function runTests() {
       await MIDITestUtils.permissionSetup(true);
       try {
         await navigator.requestMIDIAccess({ "sysex": false });
         ok(true, "Prompting for permissions succeeded!");
       } catch (e) {
         ok(false, "Prompting for permissions failed!");
       }
       SimpleTest.finish();
     }
    </script>
  </body>
</html>