Created
December 28, 2013 20:28
-
-
Save Infocatcher/8163849 to your computer and use it in GitHub Desktop.
Test Firefox/SeaMonkey extension for memory leaks: automatically opens/closes browser windows.
First appears here: https://github.com/Infocatcher/Private_Tab/issues/45#issuecomment-17063542
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var count = 25; | |
| var delay = 1000; | |
| function leakTestPrototype() { | |
| for(var i = 1; i <= count; ++i) { | |
| var win = window.openDialog(location.href, "", "chrome,all"); | |
| win.addEventListener("load", function loader(e) { | |
| win.removeEventListener(e.type, loader, false); | |
| win.setTimeout(function() { | |
| win.document.documentElement.setAttribute("titlemodifier", "[" + i + "/" + count + "]"); | |
| win.gBrowser.updateTitlebar(); | |
| }, 0); | |
| win.setTimeout(function() { | |
| win.close(); | |
| leakTestPrototype.__gen.next(); | |
| }, delay); | |
| }, false); | |
| yield; | |
| } | |
| yield; | |
| } | |
| var leakTest = leakTestPrototype.__gen = leakTestPrototype(); | |
| leakTest.next(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment