From fd0bce07584b73fb755574c4d462e0b175d1c6b6 Mon Sep 17 00:00:00 2001
From: Michał Gołębiowski <m.goleb@gmail.com>
Date: Wed, 18 Dec 2013 15:10:42 +0100
Subject: Ajax: don’t test jQuery.ajax() on beforeunload in Chrome 31
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
---
 test/unit/ajax.js | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

(limited to 'test/unit/ajax.js')

diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index ad44ba68b..77648404c 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -1532,10 +1532,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()
 
-- 
cgit v1.2.3