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

Unified Diff: third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.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
Index: third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg
diff --git a/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg b/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg
index 2bbec2247e15206ef710910e774871266e8623a3..b0b71519dfc4afcb59d797bd645874388d02ea07 100644
--- a/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg
+++ b/third_party/WebKit/LayoutTests/svg/animations/smil-leak-element-instances-noBaseValRef.svg
@@ -3,16 +3,11 @@
<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[
-
'use strict';
-function log(message) {
- var logDiv = document.getElementById('log');
- logDiv.appendChild(document.createTextNode(message));
-}
+// This test relies on --enable-leak-detection to catch leaks
function createAnimatedRectInstance() {
var use = document.createElementNS("http://www.w3.org/2000/svg", "use");
@@ -32,47 +27,10 @@ function createAnimatedRectInstance() {
return use;
}
-function cleanup() {
- // Collect garbage before recording starting live node count, in case there are live elements from previous tests.
- asyncGC(function() {
- var originalLiveElements = internals.numberOfLiveNodes();
-
- var g = document.getElementById("g");
- while (g.hasChildNodes())
- g.removeChild(g.lastChild);
-
- asyncGC(function() {
- // This is 400 instead of 200 as it creates shadow tree elements.
- var liveDelta = originalLiveElements - internals.numberOfLiveNodes() - 400;
-
- if (liveDelta === 0)
- log("PASS");
- else
- log("FAIL: " + liveDelta + " extra live node(s)");
-
- testRunner.notifyDone();
- });
- });
-}
-
-function startTest() {
+function load() {
var g = document.getElementById("g");
for (var i = 0; i < 100; i++)
g.appendChild(createAnimatedRectInstance());
-
- requestAnimationFrame(cleanup);
-}
-
-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;
- }
-
- requestAnimationFrame(startTest);
}
]]>
</script>

Powered by Google App Engine
This is Rietveld 408576698