2012-04-20 14:55:07 +00:00
|
|
|
/**
|
|
|
|
* Allow the test suite to run with other libs or jQuery's.
|
|
|
|
*/
|
|
|
|
jQuery.noConflict();
|
2010-03-23 16:19:47 +00:00
|
|
|
|
2012-06-04 22:04:11 +00:00
|
|
|
// Expose Sizzle for Sizzle's selector tests
|
|
|
|
// We remove Sizzle's globalization in jQuery
|
|
|
|
var Sizzle = Sizzle || jQuery.find;
|
|
|
|
|
2012-04-20 14:55:07 +00:00
|
|
|
/**
|
|
|
|
* QUnit hooks
|
|
|
|
*/
|
2010-07-27 10:50:08 +00:00
|
|
|
(function() {
|
2012-04-20 14:55:07 +00:00
|
|
|
// jQuery-specific QUnit.reset
|
2011-04-28 20:31:51 +00:00
|
|
|
var reset = QUnit.reset,
|
|
|
|
ajaxSettings = jQuery.ajaxSettings;
|
|
|
|
|
2010-07-27 10:50:08 +00:00
|
|
|
QUnit.reset = function() {
|
|
|
|
reset.apply(this, arguments);
|
|
|
|
jQuery.event.global = {};
|
|
|
|
jQuery.ajaxSettings = jQuery.extend({}, ajaxSettings);
|
|
|
|
};
|
|
|
|
})();
|
|
|
|
|
2012-04-20 14:55:07 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2010-03-23 16:19:47 +00:00
|
|
|
(function() {
|
|
|
|
var url = window.location.search;
|
2012-04-20 14:55:07 +00:00
|
|
|
url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + "swarmURL=".length ) );
|
|
|
|
|
2010-03-23 16:19:47 +00:00
|
|
|
if ( !url || url.indexOf("http") !== 0 ) {
|
|
|
|
return;
|
|
|
|
}
|
2010-03-24 20:04:10 +00:00
|
|
|
|
|
|
|
// (Temporarily) Disable Ajax tests to reduce network strain
|
2011-10-13 16:07:54 +00:00
|
|
|
// isLocal = QUnit.isLocal = true;
|
2010-03-24 20:04:10 +00:00
|
|
|
|
2010-03-23 19:21:42 +00:00
|
|
|
document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
|
2010-03-23 16:19:47 +00:00
|
|
|
})();
|