aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorMichał Gołębiowski <m.goleb@gmail.com>2014-11-03 19:53:22 +0100
committerMichał Gołębiowski <m.goleb@gmail.com>2014-12-08 21:12:33 +0100
commit90d7cc1d8b2ea7ac75f0eacb42439349c9c73278 (patch)
tree3302e3fce03076b1fe3e91eedba671be42bade69 /test/unit/ajax.js
parenta467f8653a6fab2903148df80ab0ce9f5f4fd04f (diff)
downloadjquery-90d7cc1d8b2ea7ac75f0eacb42439349c9c73278.tar.gz
jquery-90d7cc1d8b2ea7ac75f0eacb42439349c9c73278.zip
Misc: Drop support for older browsers; update support comments
That includes IE<8, Opera 12.x, Firefox<29, Safari<6.0 and some hacks for old Blackberry. Fixes gh-1836 Fixes gh-1701 Refs gh-1815 Refs gh-1820
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js56
1 files changed, 9 insertions, 47 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index c63fd69d9..da1f6ecb9 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -1014,9 +1014,7 @@ module( "ajax", {
" (no cache)": false
},
function( label, cache ) {
- var isOpera = !!window.opera;
-
- asyncTest( "jQuery.ajax() - If-Modified-Since support" + label, 3, function() {
+ asyncTest( "jQuery.ajax() - If-Modified-Since support" + label, 4, function() {
var url = "data/if_modified_since.php?ts=" + ifModifiedNow++;
jQuery.ajax({
@@ -1030,33 +1028,15 @@ module( "ajax", {
url: url,
ifModified: true,
cache: cache,
- success: function( data, status ) {
- if ( data === "FAIL" ) {
- ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-Modified-Since')." );
- ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-Modified-Since')." );
- } else {
- strictEqual( status, "notmodified" );
- ok( data == null, "response body should be empty" );
- }
- start();
+ success: function( data, status, jqXHR ) {
+ strictEqual( status, "notmodified", "Following status is 'notmodified'" );
+ strictEqual( jqXHR.status, 304, "XHR status is 304" );
+ equal( data, null, "no response body is given" );
},
- error: function() {
- // Do this because opera simply refuses to implement 304 handling :(
- // A feature-driven way of detecting this would be appreciated
- // See: http://gist.github.com/599419
- ok( isOpera, "error" );
- ok( isOpera, "error" );
+ complete: function() {
start();
}
});
- },
- error: function() {
- strictEqual( false, "error" );
- // Do this because opera simply refuses to implement 304 handling :(
- // A feature-driven way of detecting this would be appreciated
- // See: http://gist.github.com/599419
- ok( isOpera, "error" );
- start();
}
});
});
@@ -1076,31 +1056,13 @@ module( "ajax", {
ifModified: true,
cache: cache,
success: function( data, status ) {
- if ( data === "FAIL" ) {
- ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-None-Match')." );
- ok( isOpera, "Opera is incapable of doing .setRequestHeader('If-None-Match')." );
- } else {
- strictEqual( status, "notmodified" );
- ok( data == null, "response body should be empty" );
- }
- start();
+ strictEqual( status, "notmodified" );
+ ok( data == null, "response body should be empty" );
},
- error: function() {
- // Do this because opera simply refuses to implement 304 handling :(
- // A feature-driven way of detecting this would be appreciated
- // See: http://gist.github.com/599419
- ok( isOpera, "error" );
- ok( isOpera, "error" );
+ complete: function() {
start();
}
});
- },
- error: function() {
- // Do this because opera simply refuses to implement 304 handling :(
- // A feature-driven way of detecting this would be appreciated
- // See: http://gist.github.com/599419
- ok( isOpera, "error" );
- start();
}
});
});