X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=7c572a32cfa228bbcd66dea9aa4e435975962bfe;hb=0cf336d2c95809ef41d94131e629fd1767f054a0;hp=335c2ac4d310348eda37d17a602b9a4d63940c2a;hpb=5b38439011799ae53156d137305d9440e0cddb0a;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 335c2ac..7c572a3 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -492,7 +492,7 @@ test(".ajax() - hash", function() { test("jQuery ajax - cross-domain detection", function() { - expect( 4 ); + expect( 6 ); var loc = document.location, otherPort = loc.port === 666 ? 667 : 666, @@ -509,6 +509,15 @@ test("jQuery ajax - cross-domain detection", function() { jQuery.ajax({ dataType: "jsonp", + url: 'app:/path', + beforeSend: function( _ , s ) { + ok( s.crossDomain , "Adobe AIR app:/ URL detected as cross-domain" ); + return false; + } + }); + + jQuery.ajax({ + dataType: "jsonp", url: loc.protocol + '//somewebsitethatdoesnotexist-656329477541.com:' + ( loc.port || 80 ), beforeSend: function( _ , s ) { ok( s.crossDomain , "Test different hostnames are detected as cross-domain" ); @@ -527,6 +536,15 @@ test("jQuery ajax - cross-domain detection", function() { jQuery.ajax({ dataType: "jsonp", + url: "about:blank", + beforeSend: function( _ , s ) { + ok( s.crossDomain , "Test about:blank is detected as cross-domain" ); + return false; + } + }); + + jQuery.ajax({ + dataType: "jsonp", url: loc.protocol + "//" + loc.host, crossDomain: true, beforeSend: function( _ , s ) {