mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
No ticket: Improve line-height animation test stability
This commit is contained in:
parent
a25343001e
commit
94ae713344
18
test/unit/effects.js
vendored
18
test/unit/effects.js
vendored
@ -1416,7 +1416,8 @@ test("Do not append px to 'fill-opacity' #9548", 1, function() {
|
||||
});
|
||||
|
||||
asyncTest("line-height animates correctly (#13855)", 12, function() {
|
||||
var longDuration = 2000,
|
||||
var t0,
|
||||
longDuration = 2000,
|
||||
shortDuration = 500,
|
||||
animated = jQuery(
|
||||
"<p style='line-height: 100;'>unitless</p>" +
|
||||
@ -1427,10 +1428,14 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
|
||||
initialHeight = jQuery.map( animated, function( el ) {
|
||||
return jQuery( el ).height();
|
||||
}),
|
||||
tolerance = 1.5,
|
||||
t0 = +(new Date());
|
||||
tolerance = 1.5;
|
||||
|
||||
// Delay start to improve test stability
|
||||
setTimeout(function() {
|
||||
|
||||
t0 = +(new Date());
|
||||
animated.animate( { "line-height": "hide" }, longDuration, "linear" );
|
||||
|
||||
animated.animate( { "line-height": "hide" }, longDuration );
|
||||
setTimeout(function() {
|
||||
var progress = ( (new Date()) - t0 ) / longDuration;
|
||||
|
||||
@ -1446,7 +1451,9 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
|
||||
});
|
||||
|
||||
t0 = +(new Date());
|
||||
animated.stop( true, true ).hide().animate( { "line-height": "show" }, longDuration );
|
||||
animated.stop( true, true ).hide()
|
||||
.animate( { "line-height": "show" }, longDuration, "linear" );
|
||||
|
||||
setTimeout(function() {
|
||||
var progress = ( (new Date()) - t0 ) / longDuration;
|
||||
|
||||
@ -1463,6 +1470,7 @@ asyncTest("line-height animates correctly (#13855)", 12, function() {
|
||||
start();
|
||||
}, shortDuration );
|
||||
}, shortDuration );
|
||||
}, 50 );
|
||||
});
|
||||
|
||||
// Start 1.8 Animation tests
|
||||
|
Loading…
Reference in New Issue
Block a user