From 9dd0b010174dbfa70142a995a875a316337e1913 Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 15 Aug 2012 00:10:10 +0400 Subject: Fix #12061. Avoid window.onbeforeunload to permit multiple handlers. Close gh-894. --- test/unit/event.js | 61 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 52 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/unit/event.js b/test/unit/event.js index 753691995..727e20ac2 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -1369,20 +1369,63 @@ test("Submit event can be stopped (#11049)", function() { form.remove(); }); -test("on(beforeunload) creates/deletes window property instead of adding/removing event listener", function() { - expect(3); +// Test beforeunload event only if it supported (i.e. not Opera) +if ( window.onbeforeunload === null ) { + asyncTest("on(beforeunload)", 4, function() { + var doc, + forIE6 = 0, + iframe = jQuery("