| Index: third_party/WebKit/LayoutTests/resources/js-test.js
|
| diff --git a/third_party/WebKit/LayoutTests/resources/js-test.js b/third_party/WebKit/LayoutTests/resources/js-test.js
|
| index d94f49b5a8af1e54bbd6284b97eadf2e163d6c50..0419bca488ed8250065579d5c4db3b27385c390b 100644
|
| --- a/third_party/WebKit/LayoutTests/resources/js-test.js
|
| +++ b/third_party/WebKit/LayoutTests/resources/js-test.js
|
| @@ -765,9 +765,16 @@ function shouldHaveHadError(message)
|
| // that something is dead need to use this asynchronous collectGarbage
|
| // function.
|
| function asyncGC(callback) {
|
| + var documentsBefore = window.internals.numberOfLiveDocuments();
|
| GCController.collectAll();
|
| // FIXME: we need a better way of waiting for chromium events to happen
|
| - setTimeout(callback, 0);
|
| + setTimeout(function () {
|
| + var documentsAfter = window.internals.numberOfLiveDocuments();
|
| + if (documentsAfter < documentsBefore)
|
| + asyncGC(callback);
|
| + else
|
| + callback();
|
| + }, 0);
|
| }
|
|
|
| function gc() {
|
|
|