diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2018-12-14 22:06:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-14 22:06:44 +0100 |
commit | 9cb162f6b62b6d4403060a0f0d2065d3ae96bbcc (patch) | |
tree | 3479b91bcf0b4f263a247b121ddd76ed6a17f5f3 /test/unit/ajax.js | |
parent | 13de7c9ede1c49c30344b4347985eac341484b1e (diff) | |
download | jquery-9cb162f6b62b6d4403060a0f0d2065d3ae96bbcc.tar.gz jquery-9cb162f6b62b6d4403060a0f0d2065d3ae96bbcc.zip |
Tests: Exclude Android 4.x from repeated header names test
Android Browser only returns the last value for each header so there's no way
for jQuery get all parts.
Closes gh-4259
Ref gh-3403
Ref gh-4173
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r-- | test/unit/ajax.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index f9cd3668d..3defc0ea8 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -273,6 +273,7 @@ QUnit.module( "ajax", { }, success: function( data, _, xhr ) { var i, emptyHeader, + isAndroid = /android 4\.[0-3]/i.test( navigator.userAgent ), requestHeaders = jQuery.extend( this.headers, { "ajax-send": "test" } ), @@ -293,7 +294,16 @@ QUnit.module( "ajax", { assert.strictEqual( emptyHeader, "", "Empty header received" ); } assert.strictEqual( xhr.getResponseHeader( "Sample-Header2" ), "Hello World 2", "Second sample header received" ); - assert.strictEqual( xhr.getResponseHeader( "List-Header" ), "Item 1, Item 2", "List header received" ); + + if ( isAndroid ) { + // Support: Android 4.0-4.3 only + // Android Browser only returns the last value for each header + // so there's no way for jQuery get all parts. + assert.ok( true, "Android doesn't support repeated header names" ); + } else { + assert.strictEqual( xhr.getResponseHeader( "List-Header" ), "Item 1, Item 2", "List header received" ); + } + assert.strictEqual( xhr.getResponseHeader( "constructor" ), "prototype collision (constructor)", "constructor header received" ); assert.strictEqual( xhr.getResponseHeader( "__proto__" ), null, "Undefined __proto__ header not received" ); } |