blob: a5bbad2cd64d06373527b38ffa97325cac6f1725 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<script>
description("This tests the constructor for the MIDIConnectionEvent DOM class.");
// No initializer is passed.
shouldBe("new MIDIConnectionEvent('eventType').bubbles", "false");
shouldBe("new MIDIConnectionEvent('eventType').cancelable", "false");
shouldBe("new MIDIConnectionEvent('eventType').port", "null");
// bubbles is passed.
shouldBe("new MIDIConnectionEvent('eventType', { bubbles: false }).bubbles", "false");
shouldBe("new MIDIConnectionEvent('eventType', { bubbles: true }).bubbles", "true");
// cancelable is passed.
shouldBe("new MIDIConnectionEvent('eventType', { cancelable: false }).cancelable", "false");
shouldBe("new MIDIConnectionEvent('eventType', { cancelable: true }).cancelable", "true");
// FIXME: Add a test case to pass port once MIDIPort is available.
// All initializers are passed.
shouldBe("new MIDIConnectionEvent('eventType', { bubbles: true, cancelable: true }).bubbles", "true");
shouldBe("new MIDIConnectionEvent('eventType', { bubbles: true, cancelable: true }).cancelable", "true");
</script>
</body>
</html>