diff --git a/src/effects.js b/src/effects.js index 50b1a6ef0..49b0bf67d 100644 --- a/src/effects.js +++ b/src/effects.js @@ -27,7 +27,7 @@ function schedule() { if ( document.hidden === false && window.requestAnimationFrame ) { window.requestAnimationFrame( schedule ); } else { - window.setTimeout( schedule, jQuery.fx.interval ); + window.setTimeout( schedule, 13 ); } jQuery.fx.tick(); @@ -663,7 +663,6 @@ jQuery.fx.timer = function( timer ) { jQuery.fx.start(); }; -jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( inProgress ) { return; diff --git a/test/unit/animation.js b/test/unit/animation.js index 4af1f7f98..d57a21b7a 100644 --- a/test/unit/animation.js +++ b/test/unit/animation.js @@ -5,7 +5,8 @@ if ( !jQuery.fx ) { return; } -var oldRaf = window.requestAnimationFrame, +var fxInterval = 13, + oldRaf = window.requestAnimationFrame, defaultPrefilter = jQuery.Animation.prefilters[ 0 ], defaultTweener = jQuery.Animation.tweeners[ "*" ][ 0 ], startTime = 505877050; @@ -15,17 +16,14 @@ QUnit.module( "animation", { beforeEach: function() { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers( startTime ); - this._oldInterval = jQuery.fx.interval; window.requestAnimationFrame = null; jQuery.fx.step = {}; - jQuery.fx.interval = 10; jQuery.Animation.prefilters = [ defaultPrefilter ]; jQuery.Animation.tweeners = { "*": [ defaultTweener ] }; }, afterEach: function() { this.sandbox.restore(); jQuery.fx.stop(); - jQuery.fx.interval = this._oldInterval; window.requestAnimationFrame = oldRaf; return moduleTeardown.apply( this, arguments ); } @@ -36,7 +34,7 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) { var subject = { test: 0 }, props = { test: 1 }, - opts = { queue: "fx", duration: 100 }, + opts = { queue: "fx", duration: fxInterval * 10 }, animation = jQuery.Animation( subject, props, opts ); assert.equal( @@ -59,14 +57,14 @@ QUnit.test( "Animation( subject, props, opts ) - shape", function( assert ) { assert.deepEqual( animation.props, props, ".props is a copy of the original" ); assert.deepEqual( animation.opts, { - duration: 100, + duration: fxInterval * 10, queue: "fx", specialEasing: { test: undefined }, easing: jQuery.easing._default }, ".options is filled with default easing and specialEasing" ); assert.equal( animation.startTime, startTime, "startTime was set" ); - assert.equal( animation.duration, 100, ".duration is set" ); + assert.equal( animation.duration, fxInterval * 10, ".duration is set" ); assert.equal( animation.tweens.length, 1, ".tweens has one Tween" ); 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 ) { assert.equal( jQuery.timers[ 0 ].queue, opts.queue, "...with .queue" ); // Cleanup after ourselves by ticking to the end - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "Animation.prefilter( fn ) - calls prefilter after defaultPrefilter", diff --git a/test/unit/effects.js b/test/unit/effects.js index f75ff481a..245e75d4f 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -5,7 +5,8 @@ if ( !jQuery.fx ) { return; } -var oldRaf = window.requestAnimationFrame, +var fxInterval = 13, + oldRaf = window.requestAnimationFrame, hideOptions = { inline: function() { jQuery.style( this, "display", "none" ); }, cascade: function() { this.className = "hidden"; } @@ -15,15 +16,12 @@ QUnit.module( "effects", { beforeEach: function() { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers( 505877050 ); - this._oldInterval = jQuery.fx.interval; window.requestAnimationFrame = null; jQuery.fx.step = {}; - jQuery.fx.interval = 10; }, afterEach: function() { this.sandbox.restore(); jQuery.fx.stop(); - jQuery.fx.interval = this._oldInterval; window.requestAnimationFrame = oldRaf; return moduleTeardown.apply( this, arguments ); } @@ -160,9 +158,9 @@ supportjQuery.each( hideOptions, function( type, setup ) { }; jQuery.each( test, function( selector ) { - jQuery( selector, "#show-tests" ).show( 100 ); + jQuery( selector, "#show-tests" ).show( fxInterval * 10 ); } ); - this.clock.tick( 50 ); + this.clock.tick( fxInterval * 5 ); jQuery.each( test, function( selector, expected ) { jQuery( selector, "#show-tests" ).each( function() { assert.equal( @@ -172,7 +170,7 @@ supportjQuery.each( hideOptions, function( type, setup ) { ); } ); } ); - this.clock.tick( 50 ); + this.clock.tick( fxInterval * 5 ); jQuery.each( test, function( selector, expected ) { jQuery( selector, "#show-tests" ).each( function() { assert.equal( jQuery( this ).css( "display" ), expected, @@ -203,17 +201,17 @@ supportjQuery.each( hideOptions, function( type, setup ) { $span.hide(); - $span.fadeIn( 100, function() { + $span.fadeIn( fxInterval * 10, function() { assert.equal( $span.css( "display" ), display, "Expecting display: " + display ); - $span.fadeOut( 100, function() { + $span.fadeOut( fxInterval * 10, function() { assert.equal( $span.css( "display" ), displayNone, "Expecting display: " + displayNone ); - $span.fadeIn( 100, function() { + $span.fadeIn( fxInterval * 10, function() { assert.equal( $span.css( "display" ), display, "Expecting display: " + display ); } ); } ); } ); - clock.tick( 300 ); + clock.tick( fxInterval * 30 ); } ); // Support: IE 11+ @@ -235,17 +233,17 @@ supportjQuery.each( hideOptions, function( type, setup ) { var display = "inline"; var clock = this.clock; - $shadowChild.fadeIn( 100, function() { + $shadowChild.fadeIn( fxInterval * 10, function() { assert.equal( $shadowChild.css( "display" ), display, "Expecting shadow display: " + display ); - $shadowChild.fadeOut( 100, function() { + $shadowChild.fadeOut( fxInterval * 10, function() { assert.equal( $shadowChild.css( "display" ), displayNone, "Expecting shadow display: " + displayNone ); - $shadowChild.fadeIn( 100, function() { + $shadowChild.fadeIn( fxInterval * 10, function() { assert.equal( $shadowChild.css( "display" ), display, "Expecting shadow display: " + display ); } ); } ); } ); - clock.tick( 300 ); + clock.tick( fxInterval * 30 ); } ); } ); @@ -284,7 +282,7 @@ QUnit.test( "animate relative values", function( assert ) { baseScale = elem[ 0 ].offsetHeight / value, adjustScale = elem[ 0 ].offsetWidth / value; - elem.css( "width", base ).animate( adjust, 100, function() { + elem.css( "width", base ).animate( adjust, fxInterval * 10, function() { assert.equal( this.offsetHeight, value * baseScale + 2 * adjustScale, baseUnit + "+=" + adjustUnit ); assert.equal( this.offsetWidth, value * baseScale - 2 * adjustScale, @@ -292,52 +290,52 @@ QUnit.test( "animate relative values", function( assert ) { } ); - clock.tick( 100 ); + clock.tick( fxInterval * 10 ); } ); } ); } ); QUnit.test( "animate negative height", function( assert ) { assert.expect( 1 ); - jQuery( "#foo" ).animate( { height: -100 }, 100, function() { + jQuery( "#foo" ).animate( { height: -100 }, fxInterval * 10, function() { assert.equal( this.offsetHeight, 0, "Verify height." ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate negative margin", function( assert ) { assert.expect( 1 ); - jQuery( "#foo" ).animate( { "marginTop": -100 }, 100, function() { + jQuery( "#foo" ).animate( { "marginTop": -100 }, fxInterval * 10, function() { assert.equal( jQuery( this ).css( "marginTop" ), "-100px", "Verify margin." ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate negative margin with px", function( assert ) { assert.expect( 1 ); - jQuery( "#foo" ).animate( { marginTop: "-100px" }, 100, function() { + jQuery( "#foo" ).animate( { marginTop: "-100px" }, fxInterval * 10, function() { assert.equal( jQuery( this ).css( "marginTop" ), "-100px", "Verify margin." ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate negative padding", function( assert ) { assert.expect( 1 ); - jQuery( "#foo" ).animate( { "paddingBottom": -100 }, 100, function() { + jQuery( "#foo" ).animate( { "paddingBottom": -100 }, fxInterval * 10, function() { assert.equal( jQuery( this ).css( "paddingBottom" ), "0px", "Verify paddingBottom." ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate block as inline width/height", function( assert ) { assert.expect( 3 ); - jQuery( "#foo" ).css( { display: "inline", width: "", height: "" } ).animate( { width: 42, height: 42 }, 100, function() { + jQuery( "#foo" ).css( { display: "inline", width: "", height: "" } ).animate( { width: 42, height: 42 }, fxInterval * 10, function() { assert.equal( jQuery( this ).css( "display" ), "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); assert.equal( this.offsetWidth, 42, "width was animated" ); assert.equal( this.offsetHeight, 42, "height was animated" ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate native inline width/height", function( assert ) { @@ -346,12 +344,12 @@ QUnit.test( "animate native inline width/height", function( assert ) { jQuery( "#foo" ).css( { display: "", width: "", height: "" } ) .append( "text" ) .children( "span" ) - .animate( { width: 42, height: 42 }, 100, function() { + .animate( { width: 42, height: 42 }, fxInterval * 10, function() { assert.equal( jQuery( this ).css( "display" ), "inline-block", "inline-block was set on non-floated inline element when animating width/height" ); assert.equal( this.offsetWidth, 42, "width was animated" ); assert.equal( this.offsetHeight, 42, "height was animated" ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate block width/height", function( assert ) { @@ -366,7 +364,7 @@ QUnit.test( "animate block width/height", function( assert ) { width: 42, height: 42 }, { - duration: 100, + duration: fxInterval * 10, step: function() { if ( jQuery( this ).width() > 42 ) { assert.ok( false, "width was incorrectly augmented during animation" ); @@ -378,16 +376,16 @@ QUnit.test( "animate block width/height", function( assert ) { assert.equal( jQuery( this ).height(), 42, "height was animated" ); } } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate table width/height", function( assert ) { assert.expect( 1 ); - jQuery( "#table" ).animate( { width: 42, height: 42 }, 100, function() { + jQuery( "#table" ).animate( { width: 42, height: 42 }, fxInterval * 10, function() { assert.equal( jQuery( this ).css( "display" ), "table", "display mode is correct" ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit.test( "animate table-row width/height", function( assert ) { @@ -397,12 +395,12 @@ QUnit.test( "animate table-row width/height", function( assert ) { .html( "
unitless
" + "px
" + @@ -1472,11 +1450,11 @@ QUnit.test( "line-height animates correctly (trac-13855)", function( assert ) { animated.stop( true, true ); }, shortDuration ); -clock.tick( shortDuration ); + clock.tick( shortDuration ); }, shortDuration ); -clock.tick( shortDuration ); - }, 50 ); -clock.tick( 50 ); + clock.tick( shortDuration ); + }, fxInterval * 5 ); + clock.tick( fxInterval * 5 ); } ); // Start 1.8 Animation tests @@ -1504,7 +1482,7 @@ QUnit.test( "jQuery.Animation( object, props, opts )", function( assert ) { assert.deepEqual( testObject, testDest, "No unexpected properties" ); } ); } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "Animate Option: step: function( percent, tween )", function( assert ) { @@ -1532,7 +1510,7 @@ QUnit.test( "Animate Option: step: function( percent, tween )", function( assert }, "Step function was called once at 0% and once at 100% for each property" ); next(); } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "Animate callbacks have correct context", function( assert ) { @@ -1541,15 +1519,15 @@ QUnit.test( "Animate callbacks have correct context", function( assert ) { var foo = jQuery( "#foo" ); foo.animate( { height: 10 - }, 10, function() { + }, fxInterval, function() { assert.equal( foo[ 0 ], this, "Complete callback after stop(true) `this` is element" ); } ).stop( true, true ); foo.animate( { height: 100 - }, 10, function() { + }, fxInterval, function() { assert.equal( foo[ 0 ], this, "Complete callback `this` is element" ); } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "User supplied callback called after show when fx off (trac-8892)", function( assert ) { @@ -1571,8 +1549,7 @@ QUnit.test( "User supplied callback called after show when fx off (trac-8892)", QUnit.test( "animate should set display for disconnected nodes", function( assert ) { assert.expect( 20 ); - var env = this, - showMethods = { + var showMethods = { fadeIn: [], fadeTo: [ "fast", 0.5 ], slideDown: [ "fast" ], @@ -1625,7 +1602,7 @@ QUnit.test( "animate should set display for disconnected nodes", function( asser "." + name + " block under fragment" ); } ] ) ); } ); - clock.tick( 400 ); + clock.tick( 400 + fxInterval ); } ); QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "Animation callback should not show animated element as :animated (trac-7157)", function( assert ) { @@ -1635,10 +1612,10 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "Animation callback should not foo.animate( { opacity: 0 - }, 100, function() { + }, fxInterval * 10, function() { assert.ok( !foo.is( ":animated" ), "The element is not animated" ); } ); - this.clock.tick( 100 ); + this.clock.tick( fxInterval * 10 ); } ); QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "Initial step callback should show element as :animated (trac-14623)", function( assert ) { @@ -1677,7 +1654,7 @@ QUnit.test( "hide called on element within hidden parent should set display to n elems.remove(); } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "hide, fadeOut and slideUp called on element width height and width = 0 should set display to none", function( assert ) { @@ -1708,7 +1685,7 @@ QUnit.test( "hide, fadeOut and slideUp called on element width height and width assert.strictEqual( elems.get( 4 ).style.display, "none", "slideUp() called on element width height and width = 0 should set display to none" ); } ); - this.clock.tick( 400 ); + this.clock.tick( 400 + fxInterval ); } ); QUnit.test( "hide should not leave hidden inline elements visible (trac-14848)", function( assert ) { @@ -1735,7 +1712,7 @@ QUnit.test( "Handle queue:false promises", function( assert ) { foo.animate( { top: 1 }, { - duration: 10, + duration: fxInterval, queue: false, complete: function() { assert.ok( step++ <= 2, "Step one or two" ); @@ -1743,21 +1720,21 @@ QUnit.test( "Handle queue:false promises", function( assert ) { } ).animate( { bottom: 1 }, { - duration: 10, + duration: fxInterval, complete: function() { assert.ok( step > 2 && step < 5, "Step three or four" ); step++; } } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); foo.promise().done( function() { assert.equal( step++, 5, "steps 1-5: queue:false then queue:fx done" ); foo.animate( { top: 10 }, { - duration: 10, + duration: fxInterval, complete: function() { assert.ok( step > 5 && step < 8, "Step six or seven" ); step++; @@ -1765,7 +1742,7 @@ QUnit.test( "Handle queue:false promises", function( assert ) { } ).animate( { bottom: 10 }, { - duration: 10, + duration: fxInterval, queue: false, complete: function() { assert.ok( step > 7 && step < 10, "Step eight or nine" ); @@ -1776,7 +1753,7 @@ QUnit.test( "Handle queue:false promises", function( assert ) { } ); } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "multiple unqueued and promise", function( assert ) { @@ -1811,7 +1788,7 @@ QUnit.test( "multiple unqueued and promise", function( assert ) { } ).promise().done( function() { assert.strictEqual( step++, 4, "Step 4" ); } ); - this.clock.tick( 1000 ); + this.clock.tick( 1000 + fxInterval ); } ); QUnit.test( "animate does not change start value for non-px animation (trac-7109)", function( assert ) { @@ -1834,7 +1811,7 @@ QUnit.test( "animate does not change start value for non-px animation (trac-7109 next(); parent.remove(); } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "non-px animation handles non-numeric start (trac-11971)", function( assert ) { @@ -1866,7 +1843,7 @@ QUnit.test( "non-px animation handles non-numeric start (trac-11971)", function( assert.equal( jQuery.style( this, "backgroundPositionX" ), "42%", "End reached" ); } } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "Animation callbacks (trac-11797)", function( assert ) { @@ -1946,7 +1923,7 @@ QUnit.test( "Animation callbacks (trac-11797)", function( assert ) { assert.ok( true, "async: always" ); } } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "Animation callbacks in order (gh-2283)", function( assert ) { @@ -1986,7 +1963,7 @@ QUnit.test( "Animation callbacks in order (gh-2283)", function( assert ) { } } ).finish(); - this.clock.tick( dur + 10 ); + this.clock.tick( dur + fxInterval ); } ); QUnit.test( "Animate properly sets overflow hidden when animating width/height (trac-12117)", function( assert ) { @@ -2096,8 +2073,8 @@ jQuery.map( [ "toggle", "slideToggle", "fadeToggle" ], function( method ) { always: secondToggle } ); - //FIXME figure out why 470 - this.clock.tick( 470 ); + // FIXME figure out why 470 + this.clock.tick( 470 + fxInterval * 2 ); } ); } ); @@ -2291,7 +2268,10 @@ QUnit.test( ".finish() is applied correctly when multiple elements were animated var elems = jQuery( "012" ); - elems.animate( { opacity: 0 }, 1500 ).animate( { opacity: 1 }, 1500 ); + elems + .animate( { opacity: 0 }, fxInterval * 150 ) + .animate( { opacity: 1 }, fxInterval * 150 ); + setTimeout( function() { elems.eq( 1 ).finish(); assert.ok( !elems.eq( 1 ).queue().length, "empty queue for .finish()ed element" ); @@ -2300,7 +2280,7 @@ QUnit.test( ".finish() is applied correctly when multiple elements were animated elems.stop( true ); }, 100 ); - this.clock.tick( 1500 ); + this.clock.tick( fxInterval * 150 ); } ); QUnit.test( "slideDown() after stop() (trac-13483)", function( assert ) { @@ -2312,28 +2292,28 @@ QUnit.test( "slideDown() after stop() (trac-13483)", function( assert ) { clock = this.clock; // First test. slideUp() -> stop() in the middle -> slideDown() until the end - ul.slideUp( 1000 ); - clock.tick( 500 ); + ul.slideUp( fxInterval * 100 ); + clock.tick( fxInterval * 50 ); ul.stop( true ); ul.slideDown( 1, function() { assert.equal( ul.height(), origHeight, "slideDown() after interrupting slideUp() with stop(). Height must be in original value" ); // Second test. slideDown() -> stop() in the middle -> slideDown() until the end ul.slideUp( 1 ); - clock.tick( 10 ); - ul.slideDown( 1000 ); - clock.tick( 500 ); + clock.tick( fxInterval ); + ul.slideDown( fxInterval * 100 ); + clock.tick( fxInterval * 50 ); ul.stop( true ); ul.slideDown( 1 ); assert.equal( ul.height(), origHeight, "slideDown() after interrupting slideDown() with stop(). Height must be in original value" ); // Cleanup ul.remove(); - clock.tick( 10 ); + clock.tick( fxInterval ); } ); - clock.tick( 10 ); + clock.tick( fxInterval ); } ); QUnit.test( "Respect display value on inline elements (trac-14824)", function( assert ) { @@ -2359,7 +2339,7 @@ QUnit.test( "Respect display value on inline elements (trac-14824)", function( a } ); } ); - clock.tick( 800 ); + clock.tick( 800 + fxInterval * 2 ); } ); QUnit.test( "jQuery.easing._default (gh-2218)", function( assert ) { @@ -2383,7 +2363,7 @@ QUnit.test( "jQuery.easing._default (gh-2218)", function( assert ) { } ) .stop(); - this.clock.tick( 25 ); + this.clock.tick( 10 + fxInterval ); } ); QUnit.test( "jQuery.easing._default in Animation (gh-2218", function( assert ) { @@ -2411,7 +2391,7 @@ QUnit.test( "jQuery.easing._default in Animation (gh-2218", function( assert ) { delete jQuery.easing.custom; } ); - this.clock.tick( 10 ); + this.clock.tick( fxInterval ); } ); QUnit.test( "jQuery.easing._default in Tween (gh-2218)", function( assert ) { @@ -2464,7 +2444,7 @@ QUnit.test( "Show/hide/toggle and display: inline", function( assert ) { jQuery( "" ).each( function() { var completed, interrupted, - N = 100, + N = fxInterval * 10, fixture = jQuery( "#qunit-fixture" ), $el = jQuery( this ), kind = this.title || this.nodeName.toLowerCase(); @@ -2530,7 +2510,7 @@ function testEasing( assert, speed, easing, complete ) { assert.expect( 4 ); var options = jQuery.speed( speed, easing, complete ); - assert.equal( options.duration, 10, "Duration set properly" ); + assert.equal( options.duration, fxInterval, "Duration set properly" ); assert.equal( typeof options.easing === "function" ? options.easing() : options.easing, "linear", @@ -2541,7 +2521,7 @@ function testEasing( assert, speed, easing, complete ) { } QUnit.test( "jQuery.speed( speed, easing, complete )", function( assert ) { - testEasing( assert, 10, "linear", function() { + testEasing( assert, fxInterval, "linear", function() { assert.ok( true, "Complete called" ); } ); } ); @@ -2549,7 +2529,7 @@ QUnit.test( "jQuery.speed( speed, easing, complete )", function( assert ) { QUnit.test( "jQuery.speed( speed, easing, complete ) - with easing function", function( assert ) { testEasing( assert, - 10, + fxInterval, function() { return "linear"; }, @@ -2561,7 +2541,7 @@ QUnit.test( "jQuery.speed( speed, easing, complete ) - with easing function", fu QUnit.test( "jQuery.speed( options )", function( assert ) { testEasing( assert, { - duration: 10, + duration: fxInterval, easing: "linear", complete: function() { assert.ok( true, "Complete called" ); @@ -2571,7 +2551,7 @@ QUnit.test( "jQuery.speed( options )", function( assert ) { QUnit.test( "jQuery.speed( options ) - with easing function", function( assert ) { testEasing( assert, { - duration: 10, + duration: fxInterval, easing: function() { return "linear"; }, diff --git a/test/unit/tween.js b/test/unit/tween.js index 936797877..1c5bdc7c6 100644 --- a/test/unit/tween.js +++ b/test/unit/tween.js @@ -11,15 +11,12 @@ QUnit.module( "tween", { beforeEach: function() { this.sandbox = sinon.createSandbox(); this.clock = this.sandbox.useFakeTimers( 505877050 ); - this._oldInterval = jQuery.fx.interval; window.requestAnimationFrame = null; jQuery.fx.step = {}; - jQuery.fx.interval = 10; }, afterEach: function() { this.sandbox.restore(); jQuery.fx.stop(); - jQuery.fx.interval = this._oldInterval; window.requestAnimationFrame = oldRaf; return moduleTeardown.apply( this, arguments ); }