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

Unified Diff: LayoutTests/fast/js/resources/leak-check.js

Issue 23005006: Fix XMLHttpRequest leak document when send() is called multiple times. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unsetPendingActivity before changeState() Created 7 years, 4 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: LayoutTests/fast/js/resources/leak-check.js
diff --git a/LayoutTests/fast/dom/resources/leak-check.js b/LayoutTests/fast/js/resources/leak-check.js
similarity index 82%
rename from LayoutTests/fast/dom/resources/leak-check.js
rename to LayoutTests/fast/js/resources/leak-check.js
index 0a74f2b7f5e8c101f2e22329099befd1607abae7..efc56d83bf687037a4624bdc81c92b569cbf6204 100644
--- a/LayoutTests/fast/dom/resources/leak-check.js
+++ b/LayoutTests/fast/js/resources/leak-check.js
@@ -50,9 +50,14 @@ function doLeakTest(src, tolerance) {
loadSourceIntoIframe('about:blank', function() {
// target document unloaded...
- var countersAfter = getCounterValues();
- compareValues(countersBefore, countersAfter, tolerance);
- finishJSTest();
+ // Measure counter values on next timer event. This is needed
+ // to correctly handle deref cycles for some ActiveDOMObjects
+ // such as XMLHttpRequest.
+ setTimeout(function() {
+ var countersAfter = getCounterValues();
+ compareValues(countersBefore, countersAfter, tolerance);
+ finishJSTest();
+ }, 100);
});
});
});

Powered by Google App Engine
This is Rietveld 408576698