@@ -1146,25 +1146,42 @@ jQuery.each({
11461146} ,
11471147function ( method , defProp ) {
11481148 test ( method + "().stop()." + method + "()" , function ( ) {
1149- expect ( 4 ) ;
1149+ expect ( 8 ) ;
1150+
1151+ var animTime = 100 ;
11501152
11511153 jQuery . each ( [ "in" , "out" ] , function ( i , type ) {
11521154 var $elem = jQuery ( "#" + method . toLowerCase ( ) + type ) ,
11531155 startVal = defProp ( $elem ) ;
11541156
1155- $elem [ method ] ( "fast" ) ;
1157+ $elem [ method ] ( animTime ) ;
11561158 stop ( ) ;
11571159
11581160 setTimeout ( function ( ) {
11591161 $elem . stop ( ) ;
11601162
11611163 notEqual ( defProp ( $elem ) , startVal , ".stop() is called about halfway through animation." ) ;
11621164
1163- $elem [ method ] ( "fast" , function ( ) {
1164- equal ( defProp ( jQuery ( this ) ) , startVal , "After doing .stop() halfway, check that state has been saved for returning to original property value." ) ;
1165- start ( ) ;
1165+ $elem [ method ] ( animTime , function ( ) {
1166+ equal ( defProp ( $elem ) , startVal , "After doing .stop() halfway through hide, check that state has been saved for returning to original property value." ) ;
1167+
1168+ // Start from hidden position to show this time
1169+ $elem . hide ( ) [ method ] ( animTime ) ;
1170+ setTimeout ( function ( ) {
1171+ $elem . stop ( ) ;
1172+
1173+ notEqual ( defProp ( $elem ) , startVal , ".stop() is called about halfway through animation." ) ;
1174+
1175+ $elem [ method ] ( animTime , function ( ) {
1176+ equal ( defProp ( $elem ) , startVal , "After doing .stop() halfway through show, check that state has been saved for returning to original property value." ) ;
1177+
1178+ // Remove olddisplay data from .hide() call
1179+ jQuery . removeData ( this , "olddisplay" , true ) ;
1180+ start ( ) ;
1181+ } ) ;
1182+ } , animTime / 2 ) ;
11661183 } ) ;
1167- } , 100 ) ;
1184+ } , animTime / 2 ) ;
11681185 } ) ;
11691186 } ) ;
11701187} ) ;
0 commit comments