X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=blobdiff_plain;f=build%2Ftest%2Fdata%2Ftestrunner.js;h=25ffb3f27ba13d14081bb14a1b79877404e28285;hp=ba6fc061c66a4700875326835e57f19caec8661c;hb=2ef4093cf7f52383dd43bd361864edcda27e5c3c;hpb=4b8c7d856152df67ddab50327d6da8d68470ec7e diff --git a/build/test/data/testrunner.js b/build/test/data/testrunner.js index ba6fc06..25ffb3f 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() { @@ -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 ] );