Skip to content

Commit c11becb

Browse files
committed
Tests: Blacklist one effects test in 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
1 parent 391c21b commit c11becb

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

test/unit/effects.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,29 @@ test("animate table-row width/height", function() {
362362
});
363363

364364
test("animate table-cell width/height", function() {
365-
expect(3);
366-
var td = jQuery( "#table" )
365+
// Support: Chrome 31.
366+
// Chrome 31 reports incorrect offsetWidth on a table cell with fixed width.
367+
// This is fixed in Chrome 32 so let's just skip the failing test in Chrome 31.
368+
// See https://code.google.com/p/chromium/issues/detail?id=290399
369+
var td,
370+
chrome31 = navigator.userAgent.indexOf( " Chrome/31." ) !== -1;
371+
372+
if (chrome31) {
373+
expect(2);
374+
} else {
375+
expect(3);
376+
}
377+
378+
td = jQuery( "#table" )
367379
.attr({ "cellspacing": 0, "cellpadding": 0, "border": 0 })
368380
.html( "<tr><td style='width:42px;height:42px;padding:0;'><div style='width:20px;height:20px;'></div></td></tr>" )
369381
.find( "td" );
370382

371383
td.animate({ width: 10, height: 10 }, 100, function() {
372384
equal( jQuery( this ).css( "display" ), "table-cell", "display mode is correct" );
373-
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
385+
if (!chrome31) {
386+
equal( this.offsetWidth, 20, "width animated to shrink wrap point" );
387+
}
374388
equal( this.offsetHeight, 20, "height animated to shrink wrap point" );
375389
});
376390
this.clock.tick( 100 );

0 commit comments

Comments
 (0)