@@ -5,7 +5,8 @@ if ( !jQuery.fx ) {
55 return ;
66}
77
8- var oldRaf = window . requestAnimationFrame ,
8+ var fxInterval = 13 ,
9+ oldRaf = window . requestAnimationFrame ,
910 defaultPrefilter = jQuery . Animation . prefilters [ 0 ] ,
1011 defaultTweener = jQuery . Animation . tweeners [ "*" ] [ 0 ] ,
1112 startTime = 505877050 ;
@@ -15,17 +16,14 @@ QUnit.module( "animation", {
1516 beforeEach : function ( ) {
1617 this . sandbox = sinon . createSandbox ( ) ;
1718 this . clock = this . sandbox . useFakeTimers ( startTime ) ;
18- this . _oldInterval = jQuery . fx . interval ;
1919 window . requestAnimationFrame = null ;
2020 jQuery . fx . step = { } ;
21- jQuery . fx . interval = 10 ;
2221 jQuery . Animation . prefilters = [ defaultPrefilter ] ;
2322 jQuery . Animation . tweeners = { "*" : [ defaultTweener ] } ;
2423 } ,
2524 afterEach : function ( ) {
2625 this . sandbox . restore ( ) ;
2726 jQuery . fx . stop ( ) ;
28- jQuery . fx . interval = this . _oldInterval ;
2927 window . requestAnimationFrame = oldRaf ;
3028 return moduleTeardown . apply ( this , arguments ) ;
3129 }
@@ -36,7 +34,7 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
3634
3735 var subject = { test : 0 } ,
3836 props = { test : 1 } ,
39- opts = { queue : "fx" , duration : 100 } ,
37+ opts = { queue : "fx" , duration : fxInterval * 10 } ,
4038 animation = jQuery . Animation ( subject , props , opts ) ;
4139
4240 assert . equal (
@@ -59,14 +57,14 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
5957 assert . deepEqual ( animation . props , props , ".props is a copy of the original" ) ;
6058
6159 assert . deepEqual ( animation . opts , {
62- duration : 100 ,
60+ duration : fxInterval * 10 ,
6361 queue : "fx" ,
6462 specialEasing : { test : undefined } ,
6563 easing : jQuery . easing . _default
6664 } , ".options is filled with default easing and specialEasing" ) ;
6765
6866 assert . equal ( animation . startTime , startTime , "startTime was set" ) ;
69- assert . equal ( animation . duration , 100 , ".duration is set" ) ;
67+ assert . equal ( animation . duration , fxInterval * 10 , ".duration is set" ) ;
7068
7169 assert . equal ( animation . tweens . length , 1 , ".tweens has one Tween" ) ;
7270 assert . equal ( typeof animation . tweens [ 0 ] . run , "function" , "which has a .run function" ) ;
@@ -85,7 +83,7 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) {
8583 assert . equal ( jQuery . timers [ 0 ] . queue , opts . queue , "...with .queue" ) ;
8684
8785 // Cleanup after ourselves by ticking to the end
88- this . clock . tick ( 100 ) ;
86+ this . clock . tick ( fxInterval * 10 ) ;
8987} ) ;
9088
9189QUnit . test ( "Animation.prefilter( fn ) - calls prefilter after defaultPrefilter" ,
0 commit comments