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

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

Issue 58533003: Move fast/js/resources files to resources. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 1 month 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/js/resources/js-test-pre.js ('k') | LayoutTests/fast/js/script-tests/TEMPLATE.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/js/resources/leak-check.js
diff --git a/LayoutTests/fast/js/resources/leak-check.js b/LayoutTests/fast/js/resources/leak-check.js
deleted file mode 100644
index 90f83dad4f541c17fe856f944cc60f4229d62119..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/js/resources/leak-check.js
+++ /dev/null
@@ -1,74 +0,0 @@
-// include fast/js/resources/js-test-pre.js before this file.
-
-function doLeakTest(src, tolerance) {
- function getCounterValues() {
- testRunner.resetTestHelperControllers();
- gc();
- return {'numberOfLiveDocuments': window.internals.numberOfLiveDocuments()};
- }
-
- var frame = document.createElement('iframe');
- document.body.appendChild(frame);
- function loadSourceIntoIframe(src, callback) {
- var originalSrc = frame.src;
-
- frame.onload = function() {
- if (frame.src === originalSrc)
- return true;
-
- callback();
- return true;
- };
- 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.");
- finishJSTest();
- }
-
- loadSourceIntoIframe('about:blank', function() {
- // blank document loaded...
- var countersBefore = getCounterValues();
-
- loadSourceIntoIframe(src, function() {
- // target document loaded...
-
- loadSourceIntoIframe('about:blank', function() {
- // target document unloaded...
-
- // 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();
- }, 0);
- });
- });
- });
-}
-
-function htmlToUrl(html) {
- return 'data:text/html;charset=utf-8,' + html;
-}
-
-function grabScriptText(id) {
- return document.getElementById(id).innerText;
-}
-
-// include fast/js/resources/js-test-post.js after this file.
« no previous file with comments | « LayoutTests/fast/js/resources/js-test-pre.js ('k') | LayoutTests/fast/js/script-tests/TEMPLATE.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698