Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / constructors / gamepad-event-constructor.html
blobcdcfaf5c5a5bfd8e9379a4e0109af478c0a632bc
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <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");
16 // bubbles is passed.
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");
24 // gamepad is passed.
25 if (window.gamepadController) {
26 gamepadController.connect(0);
27 var gamepad = navigator.getGamepads()[0];
28 shouldBe("new GamepadEvent('eventType', { gamepad: gamepad }).gamepad", "gamepad");
30 </script>
31 </body>
32 </html>