diff options
author | jaubourg <j@ubourg.net> | 2012-06-11 13:59:34 +0200 |
---|---|---|
committer | jaubourg <j@ubourg.net> | 2012-06-11 14:00:16 +0200 |
commit | ac48a19b92e60f08e5b00a46b5551a503c292fd5 (patch) | |
tree | 623962004549610b85a82740baf056633427e9a1 /test/unit/support.js | |
parent | 5f35b3d9f90d07ee084d59702a54051ee51fb0d3 (diff) | |
download | jquery-ac48a19b92e60f08e5b00a46b5551a503c292fd5.tar.gz jquery-ac48a19b92e60f08e5b00a46b5551a503c292fd5.zip |
Some work to modularize ajax later on.
Diffstat (limited to 'test/unit/support.js')
-rw-r--r-- | test/unit/support.js | 67 |
1 files changed, 23 insertions, 44 deletions
diff --git a/test/unit/support.js b/test/unit/support.js index e733d520d..46ac22242 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -38,13 +38,14 @@ testIframeWithCallback( "A background on the testElement does not cause IE8 to c ok( true, "IE8 does not crash" ); }); -var userAgent = window.navigator.userAgent; +(function() { -// These tests do not have to stay -// They are here to help with upcoming support changes for 1.8 -if ( /chrome\/19\.0/i.test(userAgent) ) { - test("Verify that the support tests resolve as expected per browser", function() { - var i, + var userAgent = window.navigator.userAgent, + expected; + + // These tests do not have to stay + // They are here to help with upcoming support changes for 1.8 + if ( /chrome\/19\.0/i.test(userAgent) ) { expected = { "leadingWhitespace":true, "tbody":true, @@ -77,13 +78,7 @@ if ( /chrome\/19\.0/i.test(userAgent) ) { "cors":true, "doesNotIncludeMarginInBodyOffset":true }; - for ( i in expected ) { - equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); - } - }); -} else if ( /msie 8\.0/i.test(userAgent) ) { - test("Verify that the support tests resolve as expected per browser", function() { - var i, + } else if ( /msie 8\.0/i.test(userAgent) ) { expected = { "leadingWhitespace":false, "tbody":true, @@ -116,13 +111,7 @@ if ( /chrome\/19\.0/i.test(userAgent) ) { "cors":false, "doesNotIncludeMarginInBodyOffset":true }; - for ( i in expected ) { - equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); - } - }); -} else if ( /msie 7\.0/i.test(userAgent) ) { - test("Verify that the support tests resolve as expected per browser", function() { - var i, + } else if ( /msie 7\.0/i.test(userAgent) ) { expected = { "ajax": true, "appendChecked": false, @@ -155,13 +144,7 @@ if ( /chrome\/19\.0/i.test(userAgent) ) { "tbody": false, "style": false }; - for ( i in expected ) { - equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); - } - }); -} else if ( /msie 6\.0/i.test(userAgent) ) { - test("Verify that the support tests resolve as expected per browser", function() { - var i, + } else if ( /msie 6\.0/i.test(userAgent) ) { expected = { "leadingWhitespace":false, "tbody":false, @@ -194,13 +177,7 @@ if ( /chrome\/19\.0/i.test(userAgent) ) { "cors":false, "doesNotIncludeMarginInBodyOffset":true }; - for ( i in expected ) { - equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); - } - }); -} else if ( /5\.1\.1 safari/i.test(userAgent) ) { - test("Verify that the support tests resolve as expected per browser", function() { - var i, + } else if ( /5\.1\.1 safari/i.test(userAgent) ) { expected = { "leadingWhitespace":true, "tbody":true, @@ -233,13 +210,7 @@ if ( /chrome\/19\.0/i.test(userAgent) ) { "cors":true, "doesNotIncludeMarginInBodyOffset":true }; - for ( i in expected ) { - equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); - } - }); -} else if ( /firefox\/3\.6/i.test(userAgent) ) { - test("Verify that the support tests resolve as expected per browser", function() { - var i, + } else if ( /firefox\/3\.6/i.test(userAgent) ) { expected = { "leadingWhitespace":true, "tbody":true, @@ -272,8 +243,16 @@ if ( /chrome\/19\.0/i.test(userAgent) ) { "cors":true, "doesNotIncludeMarginInBodyOffset":true }; - for ( i in expected ) { - equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); + } + + test("Verify that the support tests resolve as expected per browser", function() { + for ( var i in expected ) { + if ( jQuery.isAjax || i !== "ajax" && i !== "cors" ) { + equal( jQuery.support[i], expected[i], "jQuery.support['" + i + "']: " + jQuery.support[i] + ", expected['" + i + "']: " + expected[i]); + } } }); -} + +})(); + + |