Mochitest should have some easy way to call garbage/cycle collector

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
10 years ago
6 months ago

People

(Reporter: smaug, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

10 years ago
We have something like   netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
  window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
        .getInterface(Components.interfaces.nsIDOMWindowUtils)
        .garbageCollect();
in many mochitests. Would be nice to have that as a helper method, so
that tests could just call SimpleTest.gc() or similar.
What's wrong with that? I find that actually easier to use than SimpleTest.gc(), which could mean anything.
> What's wrong with that?

It's impossible to remember, so takes longer to write tests.

I'm happy to have SimpleTest.garbageCollect() if gc() is seen as too obscure, I guess.  But having to remember the QI/GetI mess is just not called for.  And "GC" is the usual term for garbage collection..
Sorry, gc() is fine by me, I might remember this function when I need it. I guess I was more 'complaining' about synthesizeKey as I never could remember the arguments it needs (in which case I just would use the relevant xpcom fuctions).
Mass closing mochitest bugs that haven't had activity in the past 5 years. Please re-open or file a new bug with modern context if this is still relevant.
Status: NEW → RESOLVED
Last Resolved: 6 months ago
Resolution: --- → WONTFIX
Nowadays test do SpecialPowers.DOMWindowUtils.garbageCollect(). Not awesome, but better than what we used to have.
You need to log in before you can comment on or make changes to this bug.