blob: a0bb6b70e134a96f584783fb3756f23210a3c960 [file] [log] [blame]
<html>
<head>
<script src="../resources/worker-util.js"></script>
<script>
var worker;
function log(message)
{
document.getElementById("console").innerHTML += message + "<br>";
}
function finishTest()
{
log("PASS: database operations interrupted.");
if (window.testRunner)
testRunner.notifyDone();
}
function terminateWorker()
{
worker.terminate();
waitUntilWorkerThreadsExit(finishTest)
}
function runTest()
{
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
worker = new Worker('resources/interrupt-database.js');
worker.onmessage = function(event) {
if (event.data == "terminate")
terminateWorker();
else
log(event.data);
};
}
</script>
</head>
<body onload="runTest()">
This test makes sure that all async database operations are immediately interrupted when the worker needs to terminate.
<pre id="console">
</pre>
</body>
</html>