1 // Use the right jQuery source on the test page (and iframes)
3 /* global loadTests: false */
5 var pathname
= window
.location
.pathname
,
6 path
= pathname
.slice( 0, pathname
.lastIndexOf( "test" ) ),
7 QUnit
= window
.QUnit
|| parent
.QUnit
,
8 require
= window
.require
|| parent
.require
,
10 // Default to unminified jQuery for directly-opened iframes
18 // Define configuration parameters controlling how jQuery is loaded
20 QUnit
.config
.urlConfig
.push( {
22 label
: "Load with AMD",
23 tooltip
: "Load the AMD jQuery file (and its dependencies)"
25 QUnit
.config
.urlConfig
.push( {
27 label
: "Load unminified",
28 tooltip
: "Load the development (unminified) jQuery file"
32 // Honor AMD loading on the main window (detected by seeing QUnit on it).
33 // This doesn't apply to iframes because they synchronously expect jQuery to be there.
34 if ( urlParams
.amd
&& window
.QUnit
) {
40 // Include tests if specified
41 if ( typeof loadTests
!== "undefined" ) {
42 require( [ src
], loadTests
);
47 // Otherwise, load synchronously
49 document
.write( "<script id='jquery-js' src='" + path
+ src
+ "'><\x2Fscript>" );
51 // Synchronous-only tests (other tests are loaded from the test page)
52 if ( typeof loadTests
!== "undefined" ) {
53 document
.write( "<script src='" + path
+ "test/unit/ready.js'><\x2Fscript>" );