blob: cd7e5d148c5a13bd78193824437cbfac0dbcfe6e [file] [log] [blame]
<p>Test Timeouts (setTimeout, setInterval, clearTimeout, clearInterval).</p>
<div id=result></div>
var logIsFrozen = false;
function log(message)
if (!logIsFrozen)
document.getElementById("result").innerHTML += message + "<br>";
if (window.testRunner) {
var worker = new Worker('resources/worker-timeout.js');
worker.onmessage = function(evt) {
if ( == "DONE") {
// This flag is needed because in Chromium port, the notifyDone() does not immediately snapshots
// the result and the still-firing timer in the worker may cause more messages to be logged before
// actual termination of the test. However one objective of the test is to keep active interval
// while the worker gets destroyed, so we freeze log rather then stop the interval from firing.
// See for more info.
logIsFrozen = true;
if (window.testRunner)