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

Unified 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, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/webmidi/implicit-open-expected.txt ('k') | LayoutTests/webmidi/open-close-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/webmidi/open-close.html
diff --git a/LayoutTests/webmidi/open-close.html b/LayoutTests/webmidi/open-close.html
new file mode 100644
index 0000000000000000000000000000000000000000..3b09bc612fddba5a1ac98c087eacb91f4d149d75
--- /dev/null
+++ b/LayoutTests/webmidi/open-close.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="state-check-utils.js"></script>
+</head>
+<body>
+<script>
+description("Tests MIDIPort.open and MIDIPort.close.");
+
+function runTests(port) {
+ return Promise.resolve().then(checkStateTransition.bind(undefined, {
+ port: port,
+ method: "close",
+ initialconnection: "closed",
+ finalconnection: "closed",
+ })).then(checkStateTransition.bind(undefined, {
+ port: port,
+ method: "open",
+ initialconnection: "closed",
+ finalconnection: "open",
+ })).then(checkStateTransition.bind(undefined, {
+ port: port,
+ method: "open",
+ initialconnection: "open",
+ finalconnection: "open",
+ })).then(checkStateTransition.bind(undefined, {
+ port: port,
+ method: "close",
+ initialconnection: "open",
+ finalconnection: "closed",
+ }));
+}
+
+function successAccessCallback(a) {
+ window.access = a;
+ testPassed("requestMIDIAccess() succeeded with access " + access + ".");
+
+ runTests(access.inputs.values().next().value)
+ .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 open() and close().
+navigator.requestMIDIAccess().then(successAccessCallback, errorAccessCallback);
+
+</script>
+</body>
+</html>
« 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