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

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

Issue 206453010: NavigationAction should not retain Event. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « LayoutTests/fast/dom/resources/notify-parent.html ('k') | Source/core/loader/NavigationAction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/resources/leak-check.js
diff --git a/LayoutTests/resources/leak-check.js b/LayoutTests/resources/leak-check.js
index da041f5f5103b8d36c310f9207fd2590a0a6bd7f..5e4f708dd1fb3761426aab8952cb024800c49262 100644
--- a/LayoutTests/resources/leak-check.js
+++ b/LayoutTests/resources/leak-check.js
@@ -1,19 +1,31 @@
// include resources/js-test.js before this file.
-function doLeakTest(src, tolerance) {
- function getCounterValues() {
- testRunner.resetTestHelperControllers();
- gc();
+function getCounterValues() {
+ testRunner.resetTestHelperControllers();
+ gc();
+
+ var ret = {'numberOfLiveDocuments': window.internals.numberOfLiveDocuments()};
- var ret = {'numberOfLiveDocuments': window.internals.numberOfLiveDocuments()};
+ var refCountedInstances = JSON.parse(window.internals.dumpRefCountedInstanceCounts());
+ for (typename in refCountedInstances)
+ ret['numberOfInstances-'+typename] = refCountedInstances[typename];
- var refCountedInstances = JSON.parse(window.internals.dumpRefCountedInstanceCounts());
- for (typename in refCountedInstances)
- ret['numberOfInstances-'+typename] = refCountedInstances[typename];
+ return ret;
+}
- return ret;
+function compareValues(countersBefore, countersAfter, tolerance) {
+ for (type in tolerance) {
+ var before = countersBefore[type];
+ var after = countersAfter[type];
+
+ if (after - before <= tolerance[type])
+ testPassed('The difference of counter "'+type+'" before and after the cycle is under the threshold of '+tolerance[type]+'.');
+ else
+ testFailed('counter "'+type+'" was '+before+' before and now '+after+' after the cycle. This exceeds the threshold of '+tolerance[type]+'.');
}
+}
+function doLeakTest(src, tolerance) {
var frame = document.createElement('iframe');
document.body.appendChild(frame);
function loadSourceIntoIframe(src, callback) {
@@ -29,18 +41,6 @@ function doLeakTest(src, tolerance) {
frame.src = src;
}
- function compareValues(countersBefore, countersAfter, tolerance) {
- for (type in tolerance) {
- var before = countersBefore[type];
- var after = countersAfter[type];
-
- if (after - before <= tolerance[type])
- testPassed('The difference of counter "'+type+'" before and after the cycle is under the threshold of '+tolerance[type]+'.');
- else
- testFailed('counter "'+type+'" was '+before+' before and now '+after+' after the cycle. This exceeds the threshold of '+tolerance[type]+'.');
- }
- }
-
jsTestIsAsync = true;
if (!window.internals) {
debug("This test only runs on DumpRenderTree, as it requires existence of window.internals and cross-domain resource access check disabled.");
« no previous file with comments | « LayoutTests/fast/dom/resources/notify-parent.html ('k') | Source/core/loader/NavigationAction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698