| Index: LayoutTests/webmidi/implicit-open.html
|
| diff --git a/LayoutTests/webmidi/implicit-open.html b/LayoutTests/webmidi/implicit-open.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2aaaa97cb15fe701f10c314f74a9cbc94de214ff
|
| --- /dev/null
|
| +++ b/LayoutTests/webmidi/implicit-open.html
|
| @@ -0,0 +1,40 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../resources/js-test.js"></script>
|
| +<script src="state-check-utils.js"></script>
|
| +</head>
|
| +<body>
|
| +<script>
|
| + description("Tests MIDIPort implicit open.");
|
| +
|
| +function successAccessCallback(a) {
|
| + window.access = a;
|
| + testPassed("requestMIDIAccess() succeeded with access " + access + ".");
|
| +
|
| + checkStateTransition.bind(undefined, {
|
| + port: access.inputs.values().next().value,
|
| + method: "setonmidimessage",
|
| + initialconnection: "closed",
|
| + finalconnection: "open",
|
| + })().then(checkStateTransition.bind(undefined, {
|
| + port: access.outputs.values().next().value,
|
| + method: "send",
|
| + initialconnection: "closed",
|
| + finalconnection: "open",
|
| + })).then(finishJSTest, finishJSTest);
|
| +}
|
| +
|
| +function errorAccessCallback(error) {
|
| + testFailed("requestMIDIAccess() error callback should not be called when requesting basic access.");
|
| + finishJSTest();
|
| +}
|
| +
|
| +window.jsTestIsAsync = true;
|
| +
|
| +// Test MIDIPort state transition by send() and onmidimessage handler.
|
| +navigator.requestMIDIAccess().then(successAccessCallback, errorAccessCallback);
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|