OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script> |
| 6 description("Test that when there are multiple gamepad event listeners and one i
s getting removed the others still receive events."); |
| 7 window.jsTestIsAsync = true; |
| 8 |
| 9 if (!window.gamepadController) { |
| 10 debug("This test cannot work without gamepadController."); |
| 11 } |
| 12 |
| 13 var listenerToRemove = window.addEventListener('gamepadconnected', function() {}
); |
| 14 window.addEventListener('gamepadconnected', function() { |
| 15 testPassed("gamepadconnected event received"); |
| 16 finishJSTest(); |
| 17 }); |
| 18 window.removeEventListener('gamepadconnected', listenerToRemove); |
| 19 |
| 20 setTimeout(function() { |
| 21 testFailed("gamepadconnected event should have been recieved."); |
| 22 finishJSTest(); |
| 23 }, 50); |
| 24 |
| 25 if (gamepadController) { |
| 26 gamepadController.connect(0); |
| 27 gamepadController.dispatchConnected(0); |
| 28 } |
| 29 |
| 30 </script> |
| 31 </html> |
OLD | NEW |