gecko-dev/dom/midi/tests/test_midi_permission_prompt...

25 строки
707 B
HTML

<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>