From: Timo Tijhof Date: Fri, 20 Apr 2012 14:55:07 +0000 (-0400) Subject: Enforce 20s timeout for all unit tests. X-Git-Tag: 1.8b1~195 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=df2a22ee6149595b212ef7dca73535a853969f7b;p=jquery.git Enforce 20s timeout for all unit tests. --- diff --git a/test/data/testrunner.js b/test/data/testrunner.js index bdfbcac9a..3afb1a650 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -1,7 +1,13 @@ -jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. +/** + * Allow the test suite to run with other libs or jQuery's. + */ +jQuery.noConflict(); -// jQuery-specific QUnit.reset +/** + * QUnit hooks + */ (function() { + // jQuery-specific QUnit.reset var reset = QUnit.reset, ajaxSettings = jQuery.ajaxSettings; @@ -12,10 +18,20 @@ jQuery.noConflict(); // Allow the test to run with other libs or jQuery's. }; })(); -// load testswarm agent +/** + * QUnit configuration + */ +// Max time for stop() and asyncTest() until it aborts test +// and start()'s the next test. +QUnit.config.testTimeout = 20 * 1000; // 20 seconds + +/** + * Load the TestSwarm listener if swarmURL is in the address. + */ (function() { var url = window.location.search; - url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); + url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + "swarmURL=".length ) ); + if ( !url || url.indexOf("http") !== 0 ) { return; }