Chromium Code Reviews| 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 recieves 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 recieved"); | |
| 16 finishJSTest(); | |
| 17 }); | |
| 18 window.removeEventListener('gamepadconnected', listenerToRemove); | |
|
timvolodine
2014/06/16 13:05:17
why is this needed? adding and removing an empty l
kbalazs
2014/06/16 17:01:47
This tests that we still honor the other listeners
| |
| 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 |