Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webmidi / implicit-open.html
blob2216ffb3349229079e5210e6a920381655b3c003
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="state-check-utils.js"></script>
6 </head>
7 <body>
8 <script>
9 description("Tests MIDIPort implicit open.");
11 function resetInputDevice(port) {
12 debug("- reset input device");
13 // Reset event handlers so that close() does not cause check failures.
14 port.onstatechange = null;
15 access.onstatechange = null;
16 port.close();
17 return Promise.resolve();
20 function successAccessCallback(a) {
21 window.access = a;
22 testPassed("requestMIDIAccess() succeeded with access " + access + ".");
24 var inputPort = access.inputs.values().next().value;
25 var outputPort = access.outputs.values().next().value;
27 checkStateTransition({
28 port: inputPort,
29 method: "setonmidimessage",
30 initialconnection: "closed",
31 finalconnection: "open" }
32 ).then(resetInputDevice.bind(undefined, inputPort
33 )).then(checkStateTransition.bind(undefined, {
34 port: inputPort,
35 method: "addeventlistener",
36 initialconnection: "closed",
37 finalconnection: "open" }
38 )).then(checkStateTransition.bind(undefined, {
39 port: outputPort,
40 method: "send",
41 initialconnection: "closed",
42 finalconnection: "open" }
43 )).then(finishJSTest, finishJSTest);
46 function errorAccessCallback(error) {
47 testFailed("requestMIDIAccess() error callback should not be called when requesting basic access.");
48 finishJSTest();
51 window.jsTestIsAsync = true;
53 // Test MIDIPort state transition by send() and onmidimessage handler.
54 navigator.requestMIDIAccess().then(successAccessCallback, errorAccessCallback);
56 </script>
57 </body>
58 </html>