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 19c0b7b4f..efe54ba6c 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1519,14 +1519,20 @@ QUnit.module( "ajax", { }; } ); - 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" ); + } + ); + } // BrowserStack PATCH support sometimes breaks so on TestSwarm run the test in IE only. // Unfortunately, all IE versions gets special treatment in request object creation diff --git a/test/unit/support.js b/test/unit/support.js index b490190e8..0461f4c43 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -577,6 +577,7 @@ testIframeWithCallback( "tbody": true }; } else if ( /firefox/i.test( userAgent ) ) { + version = userAgent.match( /firefox\/(\d+)/i )[ 1 ]; expected = { "ajax": true, "appendChecked": true, @@ -610,7 +611,7 @@ testIframeWithCallback( "radioValue": true, "reliableHiddenOffsets": true, "reliableMarginRight": true, - "reliableMarginLeft": false, + "reliableMarginLeft": version >= 61, "shrinkWrapBlocks": false, "style": true, "submit": true, |