зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1817680 - Repeat GC when needed; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D188561
This commit is contained in:
Родитель
84fe257012
Коммит
c39c786d05
|
@ -313,7 +313,11 @@ function scheduleGC() {
|
|||
function* assertEventuallyWithGC(conditionFunctor, message) {
|
||||
const maxGC = 100;
|
||||
for (let i = 0; i < maxGC; ++i) {
|
||||
if (conditionFunctor()) {
|
||||
let result =
|
||||
conditionFunctor.constructor.name === "GeneratorFunction"
|
||||
? yield* conditionFunctor()
|
||||
: conditionFunctor();
|
||||
if (result) {
|
||||
ok(true, message + " (after " + i + " garbage collections)");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -93,10 +93,15 @@
|
|||
// Flush pending file deletions before checking usage.
|
||||
flushPendingFileDeletions();
|
||||
|
||||
getCurrentUsage(grabFileUsageAndContinueHandler);
|
||||
let endUsage = yield undefined;
|
||||
yield* assertEventuallyWithGC(
|
||||
function* () {
|
||||
getCurrentUsage(grabFileUsageAndContinueHandler);
|
||||
let endUsage = yield undefined;
|
||||
|
||||
is(endUsage, startUsage, "OS files deleted");
|
||||
return endUsage == startUsage;
|
||||
},
|
||||
"OS files deleted"
|
||||
);
|
||||
|
||||
finishTest();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче