Index: LayoutTests/fast/events/constructors/midi-message-event-constructor.html |
diff --git a/LayoutTests/fast/events/constructors/midi-message-event-constructor.html b/LayoutTests/fast/events/constructors/midi-message-event-constructor.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5908d3da9dd067daf64fbdb0c93330d58cad6bd8 |
--- /dev/null |
+++ b/LayoutTests/fast/events/constructors/midi-message-event-constructor.html |
@@ -0,0 +1,40 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../js/resources/js-test-pre.js"></script> |
+</head> |
+<body> |
+<script> |
+ |
+description("This tests the constructor for the MIDIMessageEvent DOM class."); |
+ |
+// No initializer is passed. |
+shouldBe("new MIDIMessageEvent('eventType').bubbles", "false"); |
+shouldBe("new MIDIMessageEvent('eventType').cancelable", "false"); |
+shouldBe("new MIDIMessageEvent('eventType').receivedTime", "0.0"); |
+shouldBe("new MIDIMessageEvent('eventType').data", "null"); |
+ |
+// bubbles is passed. |
+shouldBe("new MIDIMessageEvent('eventType', { bubbles: false }).bubbles", "false"); |
+shouldBe("new MIDIMessageEvent('eventType', { bubbles: true }).bubbles", "true"); |
+ |
+// cancelable is passed. |
+shouldBe("new MIDIMessageEvent('eventType', { cancelable: false }).cancelable", "false"); |
+shouldBe("new MIDIMessageEvent('eventType', { cancelable: true }).cancelable", "true"); |
+ |
+// receivedTime is passed. |
+shouldBe("new MIDIMessageEvent('eventType', { receivedTime: 3.14 }).receivedTime", "3.14"); |
+ |
+// data is passed. |
+shouldBeEqualToString("new MIDIMessageEvent('eventType', { data: new Uint8Array(16) }).data.toString()", "[object Uint8Array]"); |
+ |
+// All initializers are passed. |
+shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: new Uint8Array(3) }).bubbles", "true"); |
+shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: new Uint8Array(3) }).cancelable", "true"); |
+shouldBe("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: new Uint8Array(3) }).receivedTime", "1976.0501"); |
+shouldBeEqualToString("new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, receivedTime: 1976.0501, data: new Uint8Array(3) }).data.toString()", "[object Uint8Array]"); |
+ |
+</script> |
+<script src="../../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |