1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_bug343596.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,51 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=343596 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 343596</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 1.13 +</head> 1.14 +<body> 1.15 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=343596">Mozilla Bug 343596</a> 1.16 +<p id="display"></p> 1.17 +<script id="foo"></script> 1.18 +<div id="content" style="display: none"> 1.19 + 1.20 +</div> 1.21 +<pre id="test"> 1.22 +<script class="testbody" type="text/javascript"> 1.23 + 1.24 +/** Test for Bug 343596 **/ 1.25 + 1.26 +SimpleTest.waitForExplicitFinish(); 1.27 + 1.28 +/** Cut error handling, because we're going to throw on purpose**/ 1.29 +var errorHandler = window.onerror; 1.30 +window.onerror = null; 1.31 + 1.32 + 1.33 +try{ 1.34 + // Insert text into an empty script node that will cause a syntax error. 1.35 + document.getElementById("foo").appendChild(document.createTextNode("(")); 1.36 +} 1.37 +catch(ex){ 1.38 + // Note that this catch block does not execute. 1.39 + ok(false, "this catch block should not execute"); 1.40 +} 1.41 + 1.42 +setTimeout(function(){ 1.43 +ok(true,"setTimeout still executes after bogus script insertion"); 1.44 +window.error = errorHandler; 1.45 +SimpleTest.finish();}, 0); 1.46 + 1.47 + 1.48 + 1.49 + 1.50 +</script> 1.51 +</pre> 1.52 +</body> 1.53 +</html> 1.54 +