]> source.dussan.org Git - jquery.git/commitdiff
Clear timeout (prevents freezing of test suite when async tests fail) when start...
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 19 Sep 2006 10:18:57 +0000 (10:18 +0000)
committerJörn Zaefferer <joern.zaefferer@gmail.com>
Tue, 19 Sep 2006 10:18:57 +0000 (10:18 +0000)
build/test/data/testrunner.js

index a72a1c17c883b367be73ef3a9d7573791dd4c66c..db97215bee2e50d4915ed1cdb932ed5136315690 100644 (file)
@@ -8,6 +8,7 @@ var stats = {
 };
 var queue = [];
 var blocking = false;
+var timeout;
 
 function synchronize(callback) {
        queue[queue.length] = callback;
@@ -26,9 +27,11 @@ function process() {
 
 function stop() {
        blocking = true;
-       setTimeout(start, asyncTimeout * 1000);
+       timeout = setTimeout(start, asyncTimeout * 1000);
 }
 function start() {
+       if(timeout)
+               clearTimeout(timeout);
        blocking = false;
        process();
 }