From 42b740bc0256ec4e2ab1a8a131f2288f797fa13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Mon, 27 Jan 2014 18:55:53 +0100 Subject: [PATCH] Tests: Blacklist beforeunload test in iOS iOS has the window.onbeforeunload field but doesn't support the beforeunload handler making it impossible to feature-detect the support. (cherry-picked from 988d99ad278c2c9dc16c68f86bddc4df99dcd928) Fixes #14717 Closes gh-1496 --- test/unit/event.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/unit/event.js b/test/unit/event.js index 5c136afeb..781fba5f2 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1400,7 +1400,10 @@ test("Submit event can be stopped (#11049)", function() { }); // Test beforeunload event only if it supported (i.e. not Opera) -if ( window.onbeforeunload === null ) { +// Support: iOS 7+ +// iOS has the window.onbeforeunload field but doesn't support the beforeunload +// handler making it impossible to feature-detect the support. +if ( window.onbeforeunload === null && !/(ipad|iphone|ipod)/i.test( navigator.userAgent ) ) { asyncTest("on(beforeunload)", 4, function() { var win, forIE6 = 0,