| Index: third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg
|
| diff --git a/third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg b/third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg
|
| index e3e7dc4814551069d1fe7747d864c5224fa57c85..5ba53653617f5140d0e0dbbbb121318f970156e1 100644
|
| --- a/third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg
|
| +++ b/third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg
|
| @@ -3,18 +3,13 @@
|
| <rect id="rect" width="100" height="100" />
|
| </defs>
|
| <g id="g"/>
|
| -<text x="50" y="50" id="log"/>
|
| <script xlink:href="../../resources/js-test.js"></script>
|
| <script id="script">
|
| <![CDATA[
|
| +// This test relies on --enable-leak-detection to catch leaks
|
|
|
| var g = document.getElementById("g");
|
|
|
| -function log(message) {
|
| - var logDiv = document.getElementById('log');
|
| - logDiv.appendChild(document.createTextNode(message));
|
| -}
|
| -
|
| function createAnimatedRectInstance() {
|
| var use = document.createElementNS("http://www.w3.org/2000/svg", "use");
|
| use.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#rect");
|
| @@ -33,50 +28,12 @@ function createAnimatedRectInstance() {
|
| return use;
|
| }
|
|
|
| -function cleanup() {
|
| - asyncGC(function() {
|
| - var originalLiveElements = internals.numberOfLiveNodes();
|
| -
|
| - while (g.hasChildNodes())
|
| - g.removeChild(g.lastChild);
|
| -
|
| - asyncGC(function() {
|
| - // FIXME: Why 400 and not 200?
|
| - var liveDelta = originalLiveElements - internals.numberOfLiveNodes() - 400;
|
| - if (liveDelta == 0)
|
| - log("PASS");
|
| - else
|
| - log("FAIL: " + liveDelta + " extra live node(s)");
|
| -
|
| - testRunner.notifyDone();
|
| - });
|
| - });
|
| -}
|
| -
|
| -function addMoreInstances() {
|
| +function load() {
|
| for (var i = 0; i < 50; i++)
|
| g.appendChild(createAnimatedRectInstance());
|
| -
|
| - setTimeout(cleanup, 0);
|
| -}
|
|
|
| -function startTest() {
|
| for (var i = 0; i < 50; i++)
|
| g.appendChild(createAnimatedRectInstance());
|
| -
|
| - setTimeout(addMoreInstances, 100);
|
| -}
|
| -
|
| -function load() {
|
| - if (window.testRunner && window.GCController && window.internals) {
|
| - testRunner.dumpAsText();
|
| - testRunner.waitUntilDone();
|
| - } else {
|
| - log("This test only works when run with the testRunner, GCController, and internals available.");
|
| - return;
|
| - }
|
| -
|
| - setTimeout(startTest, 0);
|
| }
|
| ]]>
|
| </script>
|
|
|