Bug 1299204 - Do GC and CC even more aggressively in reftests; r=mchang

This commit is contained in:
Terrence Cole 2016-08-30 09:28:07 -07:00
Родитель e443888b98
Коммит 5f357f7c51
1 изменённых файлов: 10 добавлений и 0 удалений

Просмотреть файл

@ -39,6 +39,7 @@ var gTimeoutHook = null;
var gFailureTimeout = null;
var gFailureReason;
var gAssertionCount = 0;
var gTestCount = 0;
var gDebug;
var gVerbose = false;
@ -139,6 +140,15 @@ function SetFailureTimeout(cb, timeout)
function StartTestURI(type, uri, timeout)
{
// The GC is only able to clean up compartments after the CC runs. Since
// the JS ref tests disable the normal browser chrome and do not otherwise
// create substatial DOM garbage, the CC tends not to run enough normally.
++gTestCount;
if (gTestCount % 3000 == 0) {
CU.forceGC();
CU.forceCC();
}
// Reset gExplicitPendingPaintCount in case there was a timeout or
// the count is out of sync for some other reason
if (gExplicitPendingPaintCount != 0) {