OLD | NEW |
1 <svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/
1999/xlink" onload="load()"> | 1 <svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/
1999/xlink" onload="load()"> |
2 <defs> | 2 <defs> |
3 <rect id="rect" width="100" height="100" /> | 3 <rect id="rect" width="100" height="100" /> |
4 </defs> | 4 </defs> |
5 <g id="g"/> | 5 <g id="g"/> |
6 <text x="50" y="50" id="log"/> | 6 <text x="50" y="50" id="log"/> |
7 <script id="script"> | 7 <script id="script"> |
8 <![CDATA[ | 8 <![CDATA[ |
9 | 9 |
10 var g = document.getElementById("g"); | 10 var g = document.getElementById("g"); |
(...skipping 16 matching lines...) Expand all Loading... |
27 anim.setAttribute("dur", "10.0s"); | 27 anim.setAttribute("dur", "10.0s"); |
28 anim.setAttribute("repeatCount", 1); | 28 anim.setAttribute("repeatCount", 1); |
29 | 29 |
30 use.appendChild(anim); | 30 use.appendChild(anim); |
31 | 31 |
32 return use; | 32 return use; |
33 } | 33 } |
34 | 34 |
35 function cleanup() { | 35 function cleanup() { |
36 // Collect garbage before recording starting live node count, in case there
are live elements from previous tests. | 36 // Collect garbage before recording starting live node count, in case there
are live elements from previous tests. |
37 // FIXME: Unclear why two calls to collect() are required, see crbug.com/307
614 | 37 GCController.collectAll(); |
38 GCController.collect(); | |
39 GCController.collect(); | |
40 var originalLiveElements = internals.numberOfLiveNodes(); | 38 var originalLiveElements = internals.numberOfLiveNodes(); |
41 | 39 |
42 while (g.hasChildNodes()) | 40 while (g.hasChildNodes()) |
43 g.removeChild(g.lastChild); | 41 g.removeChild(g.lastChild); |
44 | 42 |
45 GCController.collect(); | 43 GCController.collectAll(); |
46 | 44 |
47 // FIXME: Why is this 400 instead of 200? | 45 // This is 400 instead of 200 as it creates shadow tree elements. |
48 var liveDelta = originalLiveElements - internals.numberOfLiveNodes() - 400; | 46 var liveDelta = originalLiveElements - internals.numberOfLiveNodes() - 400; |
49 if (liveDelta == 0) | 47 if (liveDelta == 0) |
50 log("PASS"); | 48 log("PASS"); |
51 else | 49 else |
52 log("FAIL: " + liveDelta + " extra live node(s)"); | 50 log("FAIL: " + liveDelta + " extra live node(s)"); |
53 | 51 |
54 testRunner.notifyDone(); | 52 testRunner.notifyDone(); |
55 } | 53 } |
56 | 54 |
57 function startTest() { | 55 function startTest() { |
(...skipping 13 matching lines...) Expand all Loading... |
71 } else { | 69 } else { |
72 log("This test only works when run with the testRunner, GCController, an
d internals available."); | 70 log("This test only works when run with the testRunner, GCController, an
d internals available."); |
73 return; | 71 return; |
74 } | 72 } |
75 | 73 |
76 setTimeout(startTest, 0); | 74 setTimeout(startTest, 0); |
77 } | 75 } |
78 ]]> | 76 ]]> |
79 </script> | 77 </script> |
80 </svg> | 78 </svg> |
OLD | NEW |