From c536e7e19ee6b48306ddfa6b7298b90c017af6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Wed, 18 Dec 2013 15:10:42 +0100 Subject: [PATCH] =?UTF-8?q?Ajax:=20don=E2=80=99t=20test=20jQuery.ajax()=20?= =?UTF-8?q?on=20beforeunload=20in=20Chrome=2031?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chrome 31 doesn't fire Ajax requests in beforeunload event handler. There is no way for us to workaround it and it's been fixed in Chrome 32 so let's just blacklist Chrome 31 as long as it's in TestSwarm. See https://code.google.com/p/chromium/issues/detail?id=321241 (cherry-picked from fd0bce07584b73fb755574c4d462e0b175d1c6b6) --- test/unit/ajax.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 8e9094d12..766a1b6a9 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1575,10 +1575,17 @@ module( "ajax", { } } ); - testIframeWithCallback( "#14379 - jQuery.ajax() on unload", "ajax/onunload.html", function( status ) { - expect( 1 ); - strictEqual( status, "success", "Request completed" ); - }); + // Support: Chrome 31. + // Chrome 31 doesn't fire Ajax requests in beforeunload event handler. + // There is no way for us to workaround it and it's been fixed in Chrome 32 + // so let's just blacklist Chrome 31 as long as it's in TestSwarm. + // See https://code.google.com/p/chromium/issues/detail?id=321241 + if ( navigator.userAgent.indexOf( " Chrome/31." ) === -1 ) { + testIframeWithCallback( "#14379 - jQuery.ajax() on unload", "ajax/onunload.html", function( status ) { + expect( 1 ); + strictEqual( status, "success", "Request completed" ); + }); + } //----------- jQuery.ajaxPrefilter()