Commit 3883a348 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[unified-heap] Fix media/encrypted-media/* liveness layout tests

Update asyncGC function to the latest version to guarantee that GCs are
indeed run without stack.

Bug: chromium:843903
Change-Id: Iaa61f27cacd99854665358720d2354522b756302
Reviewed-on: https://chromium-review.googlesource.com/1238623Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593550}
parent 03353105
......@@ -118,10 +118,18 @@ function waitForEventAndRunStep(eventName, element, func, stepTest)
// Copied from LayoutTests/resources/js-test.js.
// See it for details of why this is necessary.
function asyncGC(callback)
{
GCController.collectAll();
setTimeout(callback, 0);
function asyncGC(callback) {
if (!callback) {
return new Promise(resolve => asyncGC(resolve));
}
var documentsBefore = internals.numberOfLiveDocuments();
GCController.asyncCollectAll(function () {
var documentsAfter = internals.numberOfLiveDocuments();
if (documentsAfter < documentsBefore)
asyncGC(callback);
else
callback();
});
}
function createGCPromise()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment