X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=build%2Ftest%2Fdata%2Ftestrunner.js;h=0ff0ad50065266b9b5f2c6bfb019a69fb6562c5c;hb=955fdb87a72e0d85676db932eda9f6a4319306d9;hp=3888ad9bd3e4b448e8b2f3eaf9892046a177a085;hpb=a87fa0188b8e0f56881afdfe0e7a7afb49eb0619;p=jquery.git diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index 3888ad9..0ff0ad5 100644 --- a/build/test/data/testrunner.js +++ b/build/test/data/testrunner.js @@ -33,9 +33,13 @@ function process() { } } -function stop() { +function stop(allowFailure) { _config.blocking = true; - _config.timeout = setTimeout(start, _config.asyncTimeout * 1000); + var handler = allowFailure ? start : function() { + ok( false, "Test timed out" ); + start(); + }; + _config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); } function start() { if(_config.timeout) @@ -187,4 +191,17 @@ function t(a,b,c) { for ( var i = 0; i < f.length; i++ ) s += (s && ",") + '"' + f[i].id + '"'; isSet(f, q.apply(q,c), a + " (" + b + ")"); +} + +/** + * Add random number to url to stop IE from caching + * + * @example url("data/test.html") + * @result "data/test.html?10538358428943" + * + * @example url("data/test.php?foo=bar") + * @result "data/test.php?foo=bar&10538358345554" + */ +function url(value) { + return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000); } \ No newline at end of file