blob: a5c52976873ebc1be8f2b846d4bde948f191d731 [file] [log] [blame]
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
waitUntilWorkerThreadsExit(runTests);
} else {
log("NOTE: Test relies on window.testRunner to detect when worker threads have exited. Please run this test via DumpRenderTree");
waitUntilWorkerThreadsExit(runTests);
}
function runTests()
{
if (window.testRunner)
log("PASS: workerThreadCount = " + testRunner.workerThreadCount);
var worker = createWorker();
worker.postMessage("ping");
worker.onmessage = function(event) {
if (window.testRunner) {
if (testRunner.workerThreadCount == 1)
log("PASS: Worker thread created");
else
log("FAIL: After thread creation: testRunner.workerThreadCount = " + testRunner.workerThreadCount);
}
// Shutdown the worker.
worker.postMessage("close");
waitUntilWorkerThreadsExit(workerExited);
}
}
function workerExited()
{
log("PASS: Worker exited when close() called.");
done();
}