OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <script src="../resources/js-test.js"></script> |
| 4 <script> |
| 5 description("Test that we don't crash while dispatching pending gamepad events i
f the event handler detaches us."); |
| 6 |
| 7 if (!window.testRunner || !window.gamepadController) |
| 8 document.write('This test cannot run without testRunner or gamepadController
'); |
| 9 |
| 10 window.addEventListener('gamepadconnected', function (event) { |
| 11 shouldBeEqualToNumber('event.gamepad.index', 0); |
| 12 shouldBeEqualToNumber('eventCount', 1); |
| 13 document.write('PASS'); |
| 14 }); |
| 15 |
| 16 function start() { |
| 17 testRunner.setPageVisibility('hidden'); |
| 18 gamepadController.connect(0); |
| 19 gamepadController.connect(1); |
| 20 testRunner.setPageVisibility('visible'); |
| 21 } |
| 22 |
| 23 </script> |
| 24 <body onload="start()"> |
| 25 FAIL |
| 26 </body> |
| 27 </html> |
OLD | NEW |