Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1139)

Unified Diff: third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances.svg

Issue 2144473002: rewrite smil-leak tests to rely on layout test leak detector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/svg/animations/smil-leak-dynamically-added-element-instances-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698