Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(933)

Side by Side Diff: LayoutTests/webmidi/open-close.html

Issue 1051903002: Web MIDI: implement implicit open() on send() and setOnmidimessage() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: kouhei review Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.");
10
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 }));
33 }
34
35 function successAccessCallback(a) {
36 window.access = a;
37 testPassed("requestMIDIAccess() succeeded with access " + access + ".");
38
39 runTests(access.inputs.values().next().value)
40 .then(finishJSTest, finishJSTest);
41 }
42
43 function errorAccessCallback(error) {
44 testFailed("requestMIDIAccess() error callback should not be called when req uesting basic access.");
45 finishJSTest();
46 }
47
48 window.jsTestIsAsync = true;
49
50 // Test MIDIPort state transition by open() and close().
51 navigator.requestMIDIAccess().then(successAccessCallback, errorAccessCallback);
52
53 </script>
54 </body>
55 </html>
OLDNEW
« no previous file with comments | « LayoutTests/webmidi/implicit-open-expected.txt ('k') | LayoutTests/webmidi/open-close-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698