Tests: Don't test synchronous XHR on unload in Chrome

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

Closes gh-4536
This commit is contained in:
Michał Gołębiowski-Owczarek 2019-10-28 20:27:49 +01:00 committed by GitHub
parent 471b004326
commit c5b48c8caa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2001,6 +2001,10 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
};
} );
// 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
if ( !/chrome/i.test( navigator.userAgent ) ) {
testIframe(
"#14379 - jQuery.ajax() on unload",
"ajax/onunload.html",
@ -2009,6 +2013,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
assert.strictEqual( status, "success", "Request completed" );
}
);
}
ajaxTest( "#14683 - jQuery.ajax() - Exceptions thrown synchronously by xhr.send should be caught", 4, function( assert ) {
return [ {