1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/test/test_bug461735.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=461735 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 461735</title> 1.11 + <script type="application/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=461735">Mozilla Bug 461735</a> 1.16 +<p id="display"></p> 1.17 +<div id="content" style="display: none"> 1.18 + 1.19 +</div> 1.20 +<pre id="test"> 1.21 +<script type="application/javascript"> 1.22 +var errorFired = false; 1.23 +window.onerror = function(message, uri, line) { 1.24 + is(message, "Script error.", "Should have empty error message"); 1.25 + is(uri, 1.26 + "http://mochi.test:8888/tests/content/base/test/bug461735-redirect1.sjs", 1.27 + "Should have pre-redirect error location URI"); 1.28 + is(line, 0, "Shouldn't have a line here"); 1.29 + errorFired = true; 1.30 +} 1.31 +</script> 1.32 +<script src="bug461735-redirect1.sjs"></script> 1.33 +<script> 1.34 + is(errorFired, true, "Should have error in redirected different origin script"); 1.35 + errorFired = false; 1.36 +</script> 1.37 +<script type="application/javascript"> 1.38 +window.onerror = function(message, uri, line) { 1.39 + is(message, "ReferenceError: c is not defined", "Should have correct error message"); 1.40 + is(uri, 1.41 + "http://mochi.test:8888/tests/content/base/test/bug461735-redirect2.sjs", 1.42 + "Unexpected error location URI"); 1.43 + is(line, 3, "Should have a line here"); 1.44 + errorFired = true; 1.45 +} 1.46 +</script> 1.47 +<script src="bug461735-redirect2.sjs"></script> 1.48 +<script> 1.49 + is(errorFired, true, "Should have error in same origin script"); 1.50 +</script> 1.51 +</pre> 1.52 +</body> 1.53 +</html>