Index: LayoutTests/webmidi/legacy-ports.html |
diff --git a/LayoutTests/webmidi/legacy-ports.html b/LayoutTests/webmidi/legacy-ports.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ea9ef09084a1ecaee938250ccfe32189d289980c |
--- /dev/null |
+++ b/LayoutTests/webmidi/legacy-ports.html |
@@ -0,0 +1,35 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../resources/js-test.js"></script> |
+</head> |
+<body> |
+<script> |
+description("Tests the legacy MIDI port API support."); |
+ |
+window.jsTestIsAsync = true; |
+ |
+navigator.requestMIDIAccess().then(function(access) { |
+ window.access = access; |
+ shouldBeEqualToString('typeof(access.inputs)', 'function'); |
+ shouldBeEqualToString('typeof(access.outputs)', 'function'); |
+ |
+ window.inputs = access.inputs(); |
+ shouldBe('inputs.length', '1'); |
+ shouldBeEqualToString("inputs[0].id", "MockInputID"); |
+ shouldBeEqualToString("inputs[0].manufacturer", "MockInputManufacturer"); |
+ shouldBeEqualToString("inputs[0].name", "MockInputName"); |
+ shouldBeEqualToString("inputs[0].version", "MockInputVersion"); |
+ |
+ window.outputs = access.outputs(); |
+ shouldBeEqualToString("outputs[0].id", "MockOutputID"); |
+ shouldBeEqualToString("outputs[0].manufacturer", "MockOutputManufacturer"); |
+ shouldBeEqualToString("outputs[0].name", "MockOutputName"); |
+ shouldBeEqualToString("outputs[0].version", "MockOutputVersion"); |
+}).catch(function(e) { |
+ testFailed('e: ' + e); |
+}).then(finishJSTest, finishJSTest); |
+ |
+</script> |
+</body> |
+</html> |