Bug 658738 - Trigger additional GC+CC runs. r=gavin

This commit is contained in:
Dão Gottwald 2011-07-25 12:11:31 +02:00
parent b2d12a1e27
commit e46544b325

View File

@ -212,9 +212,16 @@ Tester.prototype = {
// is invoked to start the tests.
this.waitForWindowsState((function () {
if (this.done) {
// Schedule GC before finishing in order to be able to report an accurate
// DOM window count at the end of this test suite.
Cu.schedulePreciseGC(this.finish.bind(this));
// Schedule GC and CC runs before finishing in order to detect
// DOM windows leaked by our tests or the tested code.
Cu.schedulePreciseGC((function () {
let winutils = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
winutils.garbageCollect();
winutils.garbageCollect();
winutils.garbageCollect();
this.finish();
}).bind(this));
return;
}