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

Unified Diff: third_party/WebKit/LayoutTests/webmidi/send-system-messages.html

Issue 1963063002: Web MIDI: Tune Request [0xf6] wasn't handled correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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
Index: third_party/WebKit/LayoutTests/webmidi/send-system-messages.html
diff --git a/third_party/WebKit/LayoutTests/webmidi/send-system-messages.html b/third_party/WebKit/LayoutTests/webmidi/send-system-messages.html
new file mode 100644
index 0000000000000000000000000000000000000000..1b191a033d750064a24491b6ff610a9992550e5c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/webmidi/send-system-messages.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="../http/tests/resources/permissions-helper.js"></script>
+</head>
+<body>
+<script>
+
+description("Test if various kinds of system messages can be validated.");
+
+window.jsTestIsAsync = true;
+
+// See https://www.midi.org/specifications/item/table-1-summary-of-midi-message
+let systemMessages = (function(messages) {
+ // Prepare various combinations of messages from input message array.
+ let combinations = [];
+ for (let i = 0; i < messages.length; ++i) {
+ combinations.push(messages[i]);
+ for (let j = 0; j < messages.length; ++j) {
+ combinations.push(messages[i].concat(messages[j]));
+ for (let k = 0; k < messages.length; ++k) {
+ combinations.push(messages[i].concat(messages[j], messages[k]));
+ }
+ }
+ }
+ return combinations;
+})([[0xf1, 0x00],
+ [0xf2, 0x00, 0x00],
+ [0xf3, 0x00],
+ [0xf6]]);
+
+PermissionsHelper.setPermission('midi', 'granted').then(() => {
+ return navigator.requestMIDIAccess();
+}).then(a => {
+ output = a.outputs.values().next().value;
+
+ for (message of systemMessages) {
+ shouldNotThrow('output.send(message)');
yhirano 2016/05/10 16:08:24 optional: You don't need shouldNotThrow because if
Takashi Toyoshima 2016/05/11 05:59:16 Done.
+ }
+
+ finishJSTest();
+}).catch(e => {
+ testFailed("requestMIDIAccess() return an error.");
+ finishJSTest();
+});
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698