Skip to content

Commit

Permalink
Tests: Blacklist one effects test in Chrome 31
Browse files Browse the repository at this point in the history
Chrome 31 reports incorrect offsetWidth on a table cell with fixed width.
This is fixed in Chrome 32 so let’s just skip the failing test in Chrome 31.
See https://code.google.com/p/chromium/issues/detail?id=290399
  • Loading branch information
mgol committed Jan 21, 2014
1 parent 391c21b commit c11becb
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions test/unit/effects.js
Expand Up @@ -362,15 +362,29 @@ test("animate table-row width/height", function() {
});

test("animate table-cell width/height", function() {
expect(3);
var td = jQuery( "#table" )
// Support: Chrome 31.
// Chrome 31 reports incorrect offsetWidth on a table cell with fixed width.
// This is fixed in Chrome 32 so let's just skip the failing test in Chrome 31.
// See https://code.google.com/p/chromium/issues/detail?id=290399
var td,
chrome31 = navigator.userAgent.indexOf( " Chrome/31." ) !== -1;

if (chrome31) {
expect(2);
} else {
expect(3);
}

td = jQuery( "#table" )
.attr({ "cellspacing": 0, "cellpadding": 0, "border": 0 })
.html( "<tr><td style='width:42px;height:42px;padding:0;'><div style='width:20px;height:20px;'></div></td></tr>" )
.find( "td" );

td.animate({ width: 10, height: 10 }, 100, function() {
equal( jQuery( this ).css( "display" ), "table-cell", "display mode is correct" );
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
if (!chrome31) {
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
}
equal( this.offsetHeight, 20, "height animated to shrink wrap point" );
});
this.clock.tick( 100 );
Expand Down

0 comments on commit c11becb

Please sign in to comment.