From: jaubourg Date: Tue, 8 Jan 2013 13:04:00 +0000 (+0100) Subject: Adjusts unit test regarding exception in injected scripts so that it accounts for... X-Git-Tag: 2.0.0b1~19 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=18c376a5bd658608fb044f2289ba9440d185ba3f;p=jquery.git Adjusts unit test regarding exception in injected scripts so that it accounts for the exception being thrown in an event loop for remote scripts --- diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js index 5d229e575..d2bec12f5 100644 --- a/test/unit/manipulation.js +++ b/test/unit/manipulation.js @@ -2050,17 +2050,21 @@ test( "Ensure oldIE creates a new set on appendTo (#8894)", function() { test( "html() - script exceptions bubble (#11743)", function() { - expect( 2 ); - - raises(function() { - jQuery("#qunit-fixture").html(""); - ok( false, "error ignored" ); - }, "exception bubbled from inline script" ); + expect( 3 ); raises(function() { - jQuery("#qunit-fixture").html(""); - ok( false, "error ignored" ); - }, "exception bubbled from remote script" ); + jQuery("#qunit-fixture").html(""); + ok( false, "Exception ignored" ); + }, "Exception bubbled from inline script" ); + + var onerror = window.onerror; + window.onerror = function() { + ok( true, "Exception thrown in remote script" ); + window.onerror = onerror; + }; + + jQuery("#qunit-fixture").html(""); + ok( true, "Exception ignored" ); }); test( "checked state is cloned with clone()", function() {