X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=build%2Ftest%2Fdata%2Ftestrunner.js;h=69377e45216b48970067d81f551148c103534bc4;hb=fbd2b066a71c8c2371e11f7f6b201a9000b564e4;hp=e6cfc1eb003b3d717b0e181b790b281a7b04b034;hpb=6f510757ab47b4377c8af954418d216afda37949;p=jquery.git diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index e6cfc1e..69377e4 100644 --- a/build/test/data/testrunner.js +++ b/build/test/data/testrunner.js @@ -13,6 +13,8 @@ var _config = { asyncTimeout: 2 // seconds for async timeout }; +var isLocal = !!(window.location.protocol == 'file:'); + $(function() { $('#userAgent').html(navigator.userAgent); runTest(); @@ -39,13 +41,17 @@ function stop(allowFailure) { ok( false, "Test timed out" ); start(); }; - _config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); + // Disabled, caused too many random errors + //_config.timeout = setTimeout(handler, _config.asyncTimeout * 1000); } function start() { - if(_config.timeout) - clearTimeout(_config.timeout); - _config.blocking = false; - process(); + // A slight delay, to avoid any current callbacks + setTimeout(function(){ + if(_config.timeout) + clearTimeout(_config.timeout); + _config.blocking = false; + process(); + }, 13); } function runTest() { @@ -68,7 +74,7 @@ function test(name, callback, nowait) { name = _config.currentModule + " module: " + name; var filter = location.search.slice(1); - if ( filter && encodeURIComponent(name) != filter ) + if ( filter && encodeURIComponent(name).indexOf(filter) == -1 ) return; synchronize(function() { @@ -271,7 +277,7 @@ function url(value) { * @param Object actual * @param String message (optional) */ -function equals(expected, actual, message) { +function equals(actual, expected, message) { var result = expected == actual; message = message || (result ? "okay" : "failed"); _config.Test.push( [ result, result ? message + ": " + expected : message + " expected: " + expected + " actual: " + actual ] );