4 <script src=
"../../../resources/js-test.js"></script>
9 description("This tests the constructor for the GamepadEvent DOM class.");
11 // No initializer is passed.
12 shouldBe("new GamepadEvent('eventType').bubbles", "false");
13 shouldBe("new GamepadEvent('eventType').cancelable", "false");
14 shouldBeNull("new GamepadEvent('eventType').gamepad");
17 shouldBe("new GamepadEvent('eventType', { bubbles: false }).bubbles", "false");
18 shouldBe("new GamepadEvent('eventType', { bubbles: true }).bubbles", "true");
20 // cancelable is passed.
21 shouldBe("new GamepadEvent('eventType', { cancelable: false }).cancelable", "false");
22 shouldBe("new GamepadEvent('eventType', { cancelable: true }).cancelable", "true");
25 if (window
.gamepadController
) {
26 gamepadController
.connect(0);
27 var gamepad
= navigator
.getGamepads()[0];
28 shouldBe("new GamepadEvent('eventType', { gamepad: gamepad }).gamepad", "gamepad");