Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webmidi / open-close.html
blob3b09bc612fddba5a1ac98c087eacb91f4d149d75
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.open and MIDIPort.close.");
11 function runTests(port) {
12 return Promise.resolve().then(checkStateTransition.bind(undefined, {
13 port: port,
14 method: "close",
15 initialconnection: "closed",
16 finalconnection: "closed",
17 })).then(checkStateTransition.bind(undefined, {
18 port: port,
19 method: "open",
20 initialconnection: "closed",
21 finalconnection: "open",
22 })).then(checkStateTransition.bind(undefined, {
23 port: port,
24 method: "open",
25 initialconnection: "open",
26 finalconnection: "open",
27 })).then(checkStateTransition.bind(undefined, {
28 port: port,
29 method: "close",
30 initialconnection: "open",
31 finalconnection: "closed",
32 }));
35 function successAccessCallback(a) {
36 window.access = a;
37 testPassed("requestMIDIAccess() succeeded with access " + access + ".");
39 runTests(access.inputs.values().next().value)
40 .then(finishJSTest, finishJSTest);
43 function errorAccessCallback(error) {
44 testFailed("requestMIDIAccess() error callback should not be called when requesting basic access.");
45 finishJSTest();
48 window.jsTestIsAsync = true;
50 // Test MIDIPort state transition by open() and close().
51 navigator.requestMIDIAccess().then(successAccessCallback, errorAccessCallback);
53 </script>
54 </body>
55 </html>