OLD | NEW |
1 <svg id="svg" xmlns="http://www.w3.org/2000/svg" onload="load()"> | 1 <svg id="svg" xmlns="http://www.w3.org/2000/svg" onload="load()"> |
2 <g id="g"/> | 2 <g id="g"/> |
3 <text x="50" y="50" id="log"/> | 3 <text x="50" y="50" id="log"/> |
4 <script id="script"> | 4 <script id="script"> |
5 <![CDATA[ | 5 <![CDATA[ |
6 | 6 |
7 var g = document.getElementById("g"); | 7 var g = document.getElementById("g"); |
8 | 8 |
9 function log(message) { | 9 function log(message) { |
10 var logDiv = document.getElementById('log'); | 10 var logDiv = document.getElementById('log'); |
(...skipping 14 matching lines...) Expand all Loading... |
25 anim.setAttribute("dur", "10.0s"); | 25 anim.setAttribute("dur", "10.0s"); |
26 anim.setAttribute("repeatCount", 1); | 26 anim.setAttribute("repeatCount", 1); |
27 | 27 |
28 rect.appendChild(anim); | 28 rect.appendChild(anim); |
29 | 29 |
30 return rect; | 30 return rect; |
31 } | 31 } |
32 | 32 |
33 function cleanup() { | 33 function cleanup() { |
34 // Collect garbage before recording starting live node count, in case there
are live elements from previous tests. | 34 // Collect garbage before recording starting live node count, in case there
are live elements from previous tests. |
35 // FIXME: Unclear why two calls to collect() are required, see crbug.com/307
614 | 35 GCController.collectAll(); |
36 GCController.collect(); | |
37 GCController.collect(); | |
38 var originalLiveElements = internals.numberOfLiveNodes(); | 36 var originalLiveElements = internals.numberOfLiveNodes(); |
39 | 37 |
40 while (g.hasChildNodes()) | 38 while (g.hasChildNodes()) |
41 g.removeChild(g.lastChild); | 39 g.removeChild(g.lastChild); |
42 | 40 |
43 GCController.collect(); | 41 GCController.collectAll(); |
44 | 42 |
45 var liveDelta = originalLiveElements - internals.numberOfLiveNodes() - 200; | 43 var liveDelta = originalLiveElements - internals.numberOfLiveNodes() - 200; |
46 if (liveDelta == 0) | 44 if (liveDelta == 0) |
47 log("PASS"); | 45 log("PASS"); |
48 else | 46 else |
49 log("FAIL: " + liveDelta + " extra live node(s)"); | 47 log("FAIL: " + liveDelta + " extra live node(s)"); |
50 | 48 |
51 testRunner.notifyDone(); | 49 testRunner.notifyDone(); |
52 } | 50 } |
53 | 51 |
(...skipping 11 matching lines...) Expand all Loading... |
65 } else { | 63 } else { |
66 log("This test only works when run with the testRunner, GCController, an
d internals available."); | 64 log("This test only works when run with the testRunner, GCController, an
d internals available."); |
67 return; | 65 return; |
68 } | 66 } |
69 | 67 |
70 setTimeout(startTest, 0); | 68 setTimeout(startTest, 0); |
71 } | 69 } |
72 ]]> | 70 ]]> |
73 </script> | 71 </script> |
74 </svg> | 72 </svg> |
OLD | NEW |