OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <script src="../resources/js-test.js"></script> |
| 4 <script src="resources/netinfo_common.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <script> |
| 8 |
| 9 description('Tests that used listeners are not collected.'); |
| 10 |
| 11 shouldBe('typeof window.internals.observeGC', '"function"', |
| 12 'this test requires window.internals'); |
| 13 |
| 14 var callback = function(e) { |
| 15 testFailed("Should not get here."); |
| 16 }; |
| 17 |
| 18 // Add a listener and make sure that the callback |
| 19 // doesn't get collected. |
| 20 var callbackObserver = internals.observeGC(callback); |
| 21 connection.addEventListener('typechange', callback); |
| 22 callback = null; |
| 23 gc(); |
| 24 shouldBeFalse('callbackObserver.wasCollected'); |
| 25 finishJSTest(); |
| 26 |
| 27 </script> |
| 28 </body> |
| 29 </html> |
OLD | NEW |