X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=a0f3d49f2d4c5b4031eab9bde53fd138426b9779;hb=796d25cf07ad63e2008ff4b70db182d33a3533dd;hp=4ce14c24cf6bd3d046f8e287d440f667b6cce3bc;hpb=e57b73a0ac6f8fd0cdbbe7d43f1c7e198f475337;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 4ce14c2..a0f3d49 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -710,10 +710,10 @@ test("jQuery.getScript(String, Function) - no callback", function() { }); test("jQuery.ajax() - JSONP, Local", function() { - expect(8); + expect(9); var count = 0; - function plus(){ if ( ++count == 8 ) start(); } + function plus(){ if ( ++count == 9 ) start(); } stop(); @@ -828,6 +828,17 @@ test("jQuery.ajax() - JSONP, Local", function() { plus(); } }); + + //#7578 + jQuery.ajax({ + url: "data/jsonp.php", + dataType: "jsonp", + beforeSend: function(){ + strictEqual( this.cache, false, "cache must be false on JSON request" ); + plus(); + return false; + } + }); }); test("JSONP - Custom JSONP Callback", function() { @@ -1350,6 +1361,16 @@ test("jQuery.ajax - active counter", function() { ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active ); }); +test( "jQuery.ajax - Location object as url (#7531)", 1, function () { + var success = false; + try { + var xhr = jQuery.ajax({ url: document.location }); + success = true; + xhr.abort(); + } catch (e) {} + + ok( success, "document.location did not generate exception" ); +}); }