aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2013-01-08 14:04:00 +0100
committerjaubourg <j@ubourg.net>2013-01-08 14:04:00 +0100
commit18c376a5bd658608fb044f2289ba9440d185ba3f (patch)
tree398c4d132fa998fa34b33da94c397c914f77f4a7
parent7cc629d0979fdc3b0a65d4501a3d71303708dee2 (diff)
downloadjquery-18c376a5bd658608fb044f2289ba9440d185ba3f.tar.gz
jquery-18c376a5bd658608fb044f2289ba9440d185ba3f.zip
Adjusts unit test regarding exception in injected scripts so that it accounts for the exception being thrown in an event loop for remote scripts
-rw-r--r--test/unit/manipulation.js22
1 files changed, 13 insertions, 9 deletions
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("<script>undefined(); ok( false, 'error not thrown' );</script>");
- ok( false, "error ignored" );
- }, "exception bubbled from inline script" );
+ expect( 3 );
raises(function() {
- jQuery("#qunit-fixture").html("<script src='data/badcall.js'></script>");
- ok( false, "error ignored" );
- }, "exception bubbled from remote script" );
+ jQuery("#qunit-fixture").html("<script>undefined(); ok( false, 'Exception not thrown' );</script>");
+ 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("<script src='data/badcall.js'></script>");
+ ok( true, "Exception ignored" );
});
test( "checked state is cloned with clone()", function() {