<!DOCTYPE html>
<head>
<script src="../resources/js-test.js"></script>
<script src="resources/netinfo_common.js"></script>
</head>
<body>
<script>
description('Tests that used listeners are not collected.');
shouldBe('typeof internals.observeGC', '"function"',
'this test requires window.internals');
var callback = function(e) {
testFailed("Should not get here.");
};
// Add a listener and make sure that the callback
// doesn't get collected.
var callbackObserver = internals.observeGC(callback);
connection.addEventListener('typechange', callback);
callback = null;
gc();
shouldBeFalse('callbackObserver.wasCollected');
finishJSTest();
</script>
</body>
</html>