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

Unified Diff: LayoutTests/fast/workers/worker-document-leak.html

Issue 953793002: Oilpan: improve fast/workers/worker-document-leak.html stability. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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
Index: LayoutTests/fast/workers/worker-document-leak.html
diff --git a/LayoutTests/fast/workers/worker-document-leak.html b/LayoutTests/fast/workers/worker-document-leak.html
index 1e601c84e6b34247a4382248c89bbf0d7b9fe6a2..fc99dbe02792effcc87e25034f9691dd04b48796 100644
--- a/LayoutTests/fast/workers/worker-document-leak.html
+++ b/LayoutTests/fast/workers/worker-document-leak.html
@@ -1,10 +1,15 @@
<!DOCTYPE html>
<html>
-<body>
-<p>Verify that creation of a worker does not leak its creating document.</p>
-<div id='console'></div>
+<head>
+<script src="../../resources/js-test.js"></script>
<script src='resources/worker-util.js'></script>
+</script>
+<body>
<script>
+description('Verify that creation of a worker does not leak its creating document.');
+
+window.jsTestIsAsync = true;
+
function log(message)
{
document.getElementById("console").innerHTML += message + "<br>";
@@ -41,7 +46,7 @@ function startTest()
// live document at this point.
runOneIteration();
} else {
- log("window.internals.numberOfLiveDocuments not available -- no point in running test");
+ debug("window.internals.numberOfLiveDocuments not available -- no point in running test");
finishTest();
}
}
@@ -58,9 +63,9 @@ function runOneIteration() {
iframe.setAttribute("src", "resources/worker-document-leak-iframe.html");
if (createdIframe)
document.body.appendChild(iframe);
- } else {
- finishTest();
+ return;
}
+ asyncGC(finishTest);
}
function finishTest()
@@ -73,14 +78,12 @@ function finishTest()
// at the end be more than 1 greater than the number at the
// beginning (because of the iframe).
if (numLiveAtEnd > numLiveAtStart + 1) {
- log("FAIL: leaked documents during test run (started with " + numLiveAtStart + ", ended with " + numLiveAtEnd + ")");
+ testFailed("leaked documents during test run (started with " + numLiveAtStart + ", ended with " + numLiveAtEnd + ")");
} else {
- log("PASS: did not leak documents during test run");
+ testPassed("did not leak documents during test run");
}
}
-
- if (window.testRunner)
- testRunner.notifyDone();
+ finishJSTest();
}
window.onload = startTest;
« no previous file with comments | « LayoutTests/fast/workers/shared-worker-lifecycle.html ('k') | LayoutTests/fast/workers/worker-document-leak-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698