X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=build%2Ftest%2Fdata%2Ftestrunner.js;h=69377e45216b48970067d81f551148c103534bc4;hb=fbd2b066a71c8c2371e11f7f6b201a9000b564e4;hp=ba6fc061c66a4700875326835e57f19caec8661c;hpb=4b8c7d856152df67ddab50327d6da8d68470ec7e;p=jquery.git diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index ba6fc06..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() { @@ -125,13 +131,13 @@ function test(name, callback, nowait) { else n.style.display = "none"; }; - b.ondblclick = function(event) { + $(b).dblclick(function(event) { var target = jQuery(event.target).filter("strong").clone(); if ( target.length ) { target.children().remove(); location.href = location.href.match(/^(.+?)(\?.*)?$/)[1] + "?" + encodeURIComponent($.trim(target.text())); } - }; + }); li.appendChild( b ); li.appendChild( ol ); @@ -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 ] );