TestManager = { /* * Load a version of a file based on URL parameters. * * dev Uncompressed development version: source files in the project /dist dir * raw Non-combined dev version: source files from the project /src dir * min Minified version in the project /dist dir * VER Version from code.jquery.com, e.g.: git, 1.8.2.min or 1.7rc1 * else Full or relative path to be used for script src */ loadProject: function( projectName, defaultVersion, isSelf ) { var file, i, lines = "", urlTag = this.projects[ projectName ].urlTag, matcher = new RegExp( "\\b" + urlTag + "=([^&]+)" ), projectRoot = this.baseURL + ( isSelf ? ".." : "../../" + projectName ), version = ( matcher.exec( document.location.search ) || {} )[ 1 ] || defaultVersion; if ( window.__karma__ && isSelf ) { projectRoot = "/base"; } if ( version === "raw" ) { // Order is important file = [ "version", "migrate", "core", "ajax", "attributes", "css", "data", "effects", "event", "offset", "serialize", "traversing", "deferred" ]; for ( i = 0; i < file.length; i++ ) { file[ i ] = projectRoot + "/src/" + file[ i ] + ".js"; } } else if ( version === "dev" ) { file = projectRoot + "/dist/" + projectName + ".js"; } else if ( version === "min" ) { file = projectRoot + "/dist/" + projectName + ".min.js"; } else if ( /^[\w\.\-]+$/.test( version ) ) { file = "http://code.jquery.com/" + projectName + "-" + version + ".js"; } else { file = version; } this.loaded.push( { projectName: projectName, tag: version, file: file } ); if ( typeof file === "string" ) { document.write( "" ); } else { for ( i = 0; i < file.length; i++ ) { lines += ""; } document.write( lines ); } }, /** * Iframe tests that require setup not covered in the standard unit test * * Note that options passed into the standard unit tests will also be passed to * the iframe, but the iframe html page is responsible for processing them * as appropriate (for example by calling TestManager.loadProject) */ runIframeTest: function( title, url, func ) { var self = this; QUnit.test( title, function( assert ) { var iframe, query = window.location.search.slice( 1 ), done = assert.async(); self.iframeCallback = function() { var args = Array.prototype.slice.call( arguments ); args.unshift( assert ); setTimeout( function() { self.iframeCallback = undefined; func.apply( this, args ); func = function() {}; iframe.remove(); done(); } ); }; iframe = jQuery( "
" ) .css( { position: "absolute", width: "500px", left: "-600px" } ) .append( jQuery( "