summaryrefslogtreecommitdiffstats
path: root/android_webview/tools/WebViewShell/test/blink-apis/webmidi/requestmidiaccess.html
blob: 58258bed83369f7ea27a10c479dfeff3a2fe2173 (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
25
<!DOCTYPE html>
<html>
  <script src="../../resources/js-test.js"></script>
  <body>
    <script type="text/javascript">
      description("Test navigator.requestMIDIAccess API in WebView");
      window.jsTestIsAsync = true;

      function onMIDIError(errorMessage) {
        testFailed('requestMIDIAccess error callback, reason: ' + errorMessage);
        finishJSTest();
      }

      function onMIDISuccess(access) {
        window.access = access;
        shouldBeTrue('access.sysexEnabled');
        testPassed('requestMIDIAccess with option sysex:true succeeded.');
        finishJSTest();
      }

      navigator.requestMIDIAccess({sysex:true}).then(
          onMIDISuccess, onMIDIError);
    </script>
  </body>
</html>