OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../js/resources/js-test-pre.js"></script> | 2 <script src="../js/resources/js-test-pre.js"></script> |
3 <script> | 3 <script> |
4 | 4 |
5 description('Tests that we do not hold on to any nodes'); | 5 description('Tests that we do not hold on to any nodes'); |
6 | 6 |
7 gc(); | 7 gc(); |
8 | 8 |
9 function numberOfLiveNodes() { | 9 function numberOfLiveNodes() { |
10 return window.internals && window.internals.numberOfLiveNodes && window.inte
rnals.numberOfLiveNodes(); | 10 return window.internals && window.internals.numberOfLiveNodes && window.inte
rnals.numberOfLiveNodes(); |
11 } | 11 } |
12 | 12 |
13 var beforeCount = numberOfLiveNodes(); | 13 var beforeCount = numberOfLiveNodes(); |
14 | 14 |
15 var f = document.createElement('form'); | 15 var f = document.createElement('form'); |
16 var i = f.appendChild(document.createElement('input')); | 16 var i = f.appendChild(document.createElement('input')); |
17 i.setAttribute('onclick', ''); | 17 i.setAttribute('onclick', ''); |
18 f.removeChild(i); | 18 f.removeChild(i); |
19 f = null; | 19 f = null; |
20 i = null; | 20 i = null; |
21 gc(); | 21 gc(); |
22 | 22 |
23 var afterCount = numberOfLiveNodes(); | 23 var afterCount = numberOfLiveNodes(); |
24 | 24 |
25 shouldBe('afterCount - beforeCount', '0'); | 25 shouldBe('afterCount - beforeCount', '0'); |
26 | 26 |
27 </script> | 27 </script> |
28 <script src="../js/resources/js-test-post.js"></script> | 28 <script src="../js/resources/js-test-post.js"></script> |
OLD | NEW |