blob: b13fbb5cbddbd0ca81e79e4295b7094c8c483d4c [file] [log] [blame]
<!DOCTYPE html>
<body>
<script src="../resources/js-test.js"></script>
<script>
description("Tests the GamepadEvent constructor");
shouldThrowErrorName("new GamepadEvent()", "TypeError");
shouldNotThrow("event = new GamepadEvent('test')");
shouldBeEqualToString("event.type", "test");
shouldBeNull("event.gamepad");
shouldBeFalse("event.bubbles");
shouldBeFalse("event.cancelable");
shouldBeFalse("event.composed");
shouldNotThrow("event = new GamepadEvent('test', {'bubbles': true, 'cancelable': true, 'composed': true })");
shouldBeNull("event.gamepad");
shouldBeTrue("event.bubbles");
shouldBeTrue("event.cancelable");
shouldBeTrue("event.composed");
shouldBeDefined("navigator.getGamepads");
</script>
</body>