// Tests are always loaded async
QUnit.config.autostart = false;
this.loadTests = function() {
+
// Leverage QUnit URL parsing to detect testSwarm environment and "basic" testing mode
- var loadSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0,
- basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";
+ QUnit.isSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0;
+ QUnit.basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";
// Get testSubproject from testrunner first
require( [ "data/testrunner.js" ], function() {
var dep = tests[ i++ ];
if ( dep ) {
- if ( !basicTests || i === 1 ) {
+ if ( !QUnit.basicTests || i === 1 ) {
require( [ dep ], loadDep );
// Support: Android 2.3 only
}
// Load the TestSwarm listener if swarmURL is in the address.
- if ( loadSwarm ) {
+ if ( QUnit.isSwarm ) {
require( [ "http://swarm.jquery.org/js/inject.js?" + ( new Date() ).getTime() ],
function() {
QUnit.start();
this.clock.tick( 100 );
} );
-QUnit.test( "stop() - several in queue", function( assert ) {
- assert.expect( 5 );
+// In IE9 inside testswarm this test doesn't work properly
+( function() {
+ var type = "test";
- var nw, $foo = jQuery( "#foo" );
+ if ( QUnit.isSwarm && /msie 9\.0/i.test( window.navigator.userAgent ) ) {
+ type = "skip";
+ }
- // default duration is 400ms, so 800px ensures we aren't 0 or 1 after 1ms
- $foo.hide().css( "width", 800 );
+ QUnit[ type ]( "stop() - several in queue", function( assert ) {
+ assert.expect( 5 );
- $foo.animate( { "width": "show" }, 400, "linear" );
- $foo.animate( { "width": "hide" } );
- $foo.animate( { "width": "show" } );
+ var nw, $foo = jQuery( "#foo" );
- this.clock.tick( 1 );
+ // default duration is 400ms, so 800px ensures we aren't 0 or 1 after 1ms
+ $foo.hide().css( "width", 800 );
- jQuery.fx.tick();
- assert.equal( $foo.queue().length, 3, "3 in the queue" );
+ $foo.animate( { "width": "show" }, 400, "linear" );
+ $foo.animate( { "width": "hide" } );
+ $foo.animate( { "width": "show" } );
- nw = $foo.css( "width" );
- assert.notEqual( parseFloat( nw ), 1, "An animation occurred " + nw );
- $foo.stop();
+ this.clock.tick( 1 );
- assert.equal( $foo.queue().length, 2, "2 in the queue" );
- nw = $foo.css( "width" );
- assert.notEqual( parseFloat( nw ), 1, "Stop didn't reset the animation " + nw );
+ jQuery.fx.tick();
+ assert.equal( $foo.queue().length, 3, "3 in the queue" );
- $foo.stop( true );
+ nw = $foo.css( "width" );
+ assert.notEqual( parseFloat( nw ), 1, "An animation occurred " + nw );
+ $foo.stop();
- assert.equal( $foo.queue().length, 0, "0 in the queue" );
-} );
+ assert.equal( $foo.queue().length, 2, "2 in the queue" );
+ nw = $foo.css( "width" );
+ assert.notEqual( parseFloat( nw ), 1, "Stop didn't reset the animation " + nw );
+
+ $foo.stop( true );
+
+ assert.equal( $foo.queue().length, 0, "0 in the queue" );
+ } );
+} )();
QUnit.test( "stop(clearQueue)", function( assert ) {
assert.expect( 4 );