mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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
(cherry picked from commit c5b48c8caa
)
This commit is contained in:
parent
bcbcdd2b2c
commit
323575fb9b
@ -2085,14 +2085,19 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
|
|||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
testIframe(
|
// Chrome 78 dropped support for synchronous XHR requests inside of
|
||||||
"#14379 - jQuery.ajax() on unload",
|
// beforeunload, unload, pagehide, and visibilitychange event handlers.
|
||||||
"ajax/onunload.html",
|
// See https://bugs.chromium.org/p/chromium/issues/detail?id=952452
|
||||||
function( assert, jQuery, window, document, status ) {
|
if ( !/chrome/i.test( navigator.userAgent ) ) {
|
||||||
assert.expect( 1 );
|
testIframe(
|
||||||
assert.strictEqual( status, "success", "Request completed" );
|
"#14379 - jQuery.ajax() on unload",
|
||||||
}
|
"ajax/onunload.html",
|
||||||
);
|
function( assert, jQuery, window, document, status ) {
|
||||||
|
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 ) {
|
ajaxTest( "#14683 - jQuery.ajax() - Exceptions thrown synchronously by xhr.send should be caught", 4, function( assert ) {
|
||||||
return [ {
|
return [ {
|
||||||
|
Loading…
Reference in New Issue
Block a user