A quick change to detect AIR urls
[jquery.git] / test / unit / ajax.js
index 80da7f8..4ce15f8 100644 (file)
@@ -344,7 +344,7 @@ test(".ajax() - retry with jQuery.ajax( this )", function() {
 
 test(".ajax() - headers" , function() {
 
-       expect( 2 );
+       expect( 4 );
 
        stop();
 
@@ -376,8 +376,14 @@ test(".ajax() - headers" , function() {
                        tmp.push(  "ajax-send: test\n" );
                        tmp = tmp.join( "" );
 
-                       equals( data , tmp , "Headers were sent" );
-                       equals( xhr.getResponseHeader( "Sample-Header" ) , "Hello World" , "Sample header received" );
+                       strictEqual( data , tmp , "Headers were sent" );
+                       strictEqual( xhr.getResponseHeader( "Sample-Header" ) , "Hello World" , "Sample header received" );
+                       if ( jQuery.browser.mozilla ) {
+                               ok( true, "Firefox doesn't support empty headers" );
+                       } else {
+                               strictEqual( xhr.getResponseHeader( "Empty-Header" ) , "" , "Empty header received" );
+                       }
+                       strictEqual( xhr.getResponseHeader( "Sample-Header2" ) , "Hello World 2" , "Second sample header received" );
                },
                error: function(){ ok(false, "error"); }
 
@@ -2233,6 +2239,18 @@ test("jQuery.ajax - active counter", function() {
     ok( jQuery.active == 0, "ajax active counter should be zero: " + jQuery.active );
 });
 
+test("jQuery.ajax - compatible with AIR urls"), function() {
+       expect( 1 );
+       stop();
+       $.ajax({
+               url: "app:/testing",
+               beforeSend: function() {
+                       ok( this.crossDomain, "Detected crossDomain for AIR Url" );
+                       return false;
+               }
+       });
+});
+
 }
 
 //}
\ No newline at end of file