|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=461735 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 461735</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
10 </head> |
|
11 <body> |
|
12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=461735">Mozilla Bug 461735</a> |
|
13 <p id="display"></p> |
|
14 <div id="content" style="display: none"> |
|
15 |
|
16 </div> |
|
17 <pre id="test"> |
|
18 <script type="application/javascript"> |
|
19 var errorFired = false; |
|
20 window.onerror = function(message, uri, line) { |
|
21 is(message, "Script error.", "Should have empty error message"); |
|
22 is(uri, |
|
23 "http://mochi.test:8888/tests/content/base/test/bug461735-redirect1.sjs", |
|
24 "Should have pre-redirect error location URI"); |
|
25 is(line, 0, "Shouldn't have a line here"); |
|
26 errorFired = true; |
|
27 } |
|
28 </script> |
|
29 <script src="bug461735-redirect1.sjs"></script> |
|
30 <script> |
|
31 is(errorFired, true, "Should have error in redirected different origin script"); |
|
32 errorFired = false; |
|
33 </script> |
|
34 <script type="application/javascript"> |
|
35 window.onerror = function(message, uri, line) { |
|
36 is(message, "ReferenceError: c is not defined", "Should have correct error message"); |
|
37 is(uri, |
|
38 "http://mochi.test:8888/tests/content/base/test/bug461735-redirect2.sjs", |
|
39 "Unexpected error location URI"); |
|
40 is(line, 3, "Should have a line here"); |
|
41 errorFired = true; |
|
42 } |
|
43 </script> |
|
44 <script src="bug461735-redirect2.sjs"></script> |
|
45 <script> |
|
46 is(errorFired, true, "Should have error in same origin script"); |
|
47 </script> |
|
48 </pre> |
|
49 </body> |
|
50 </html> |