Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(489)

Unified Diff: third_party/WebKit/LayoutTests/resources/js-test.js

Issue 1915003002: Fix abort-on-changestate-headers-received.html so it passes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698