X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fcss.js;h=efcb913d4b569acfe794a051e8d65cca47361d04;hb=0bb4fd0af72846467a4c86a47f9cfa72874c21ae;hp=116312e3fa7819db9778112a832447650916c083;hpb=22ff8e9ea46be4b145aa4963083d7c2d99ce9b0c;p=jquery.git diff --git a/test/unit/css.js b/test/unit/css.js index 116312e..efcb913 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -120,69 +120,63 @@ if(jQuery.browser.msie) { } test("css(String, Function)", function() { - try { - expect(3); + expect(3); - var sizes = ["10px", "20px", "30px"]; + var sizes = ["10px", "20px", "30px"]; - jQuery("
" + - "
" + - "
") - .appendTo("body"); + jQuery("
" + + "
" + + "
") + .appendTo("body"); - var index = 0; + var index = 0; - jQuery("#cssFunctionTest div").css("font-size", function() { - var size = sizes[index]; - index++; - return size; - }); - - index = 0; - - jQuery("#cssFunctionTest div").each(function() { - var computedSize = jQuery(this).css("font-size") - var expectedSize = sizes[index] - equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); - index++; - }); + jQuery("#cssFunctionTest div").css("font-size", function() { + var size = sizes[index]; + index++; + return size; + }); - } finally { - jQuery("#cssFunctionTest").remove(); - } + index = 0; + + jQuery("#cssFunctionTest div").each(function() { + var computedSize = jQuery(this).css("font-size") + var expectedSize = sizes[index] + equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); + index++; + }); + + jQuery("#cssFunctionTest").remove(); }); test("css(Object) where values are Functions", function() { - try { - expect(3); + expect(3); - var sizes = ["10px", "20px", "30px"]; - - jQuery("
" + - "
" + - "
") - .appendTo("body"); + var sizes = ["10px", "20px", "30px"]; - var index = 0; + jQuery("
" + + "
" + + "
") + .appendTo("body"); + + var index = 0; - jQuery("#cssFunctionTest div").css({fontSize: function() { - var size = sizes[index]; - index++; - return size; - }}); + jQuery("#cssFunctionTest div").css({fontSize: function() { + var size = sizes[index]; + index++; + return size; + }}); - index = 0; + index = 0; - jQuery("#cssFunctionTest div").each(function() { - var computedSize = jQuery(this).css("font-size") - var expectedSize = sizes[index] - equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); - index++; - }); + jQuery("#cssFunctionTest div").each(function() { + var computedSize = jQuery(this).css("font-size") + var expectedSize = sizes[index] + equals( computedSize, expectedSize, "Div #" + index + " should be " + expectedSize ); + index++; + }); - } finally { - jQuery("#cssFunctionTest").remove(); - } + jQuery("#cssFunctionTest").remove(); }); test("jQuery.css(elem, 'height') doesn't clear radio buttons (bug #1095)", function () {