diff options
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/ajax.js | 22 | ||||
-rw-r--r-- | test/unit/support.js | 3 |
2 files changed, 16 insertions, 9 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 8b46c57c2..d05d54a65 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1758,14 +1758,20 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re }; } ); - testIframeWithCallback( - "#14379 - jQuery.ajax() on unload", - "ajax/onunload.html", - function( status, assert ) { - assert.expect( 1 ); - assert.strictEqual( status, "success", "Request completed" ); - } - ); + // Chrome 78 dropped support for synchronous XHR requests inside of + // beforeunload, unload, pagehide, and visibilitychange event handlers. + // See https://bugs.chromium.org/p/chromium/issues/detail?id=952452 + // Safari 13 did similar changes. The below check will catch them both. + if ( !/safari/i.test( navigator.userAgent ) ) { + testIframeWithCallback( + "#14379 - jQuery.ajax() on unload", + "ajax/onunload.html", + function( status, assert ) { + assert.expect( 1 ); + assert.strictEqual( status, "success", "Request completed" ); + } + ); + } ajaxTest( "#14683 - jQuery.ajax() - Exceptions thrown synchronously by xhr.send should be caught", 4, function( assert ) { return [ { diff --git a/test/unit/support.js b/test/unit/support.js index e8d3715b8..437c23032 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -223,6 +223,7 @@ testIframeWithCallback( "reliableMarginRight": true }; } else if ( /firefox/i.test( userAgent ) ) { + version = userAgent.match( /firefox\/(\d+)/i )[ 1 ]; expected = { "ajax": true, "boxSizingReliable": true, @@ -237,7 +238,7 @@ testIframeWithCallback( "pixelMarginRight": true, "pixelPosition": true, "radioValue": true, - "reliableMarginLeft": false, + "reliableMarginLeft": version >= 61, "reliableMarginRight": true }; } else if ( /iphone os 9_/i.test( userAgent ) ) { |