|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=403331 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 403331</title> |
|
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
10 </head> |
|
11 <body> |
|
12 |
|
13 <iframe id="testFrame"></iframe> |
|
14 |
|
15 <pre id="test"> |
|
16 <script class="testbody" type="text/javascript"> |
|
17 |
|
18 /** Test for Bug 403331 **/ |
|
19 |
|
20 SimpleTest.waitForExplicitFinish(); |
|
21 |
|
22 function runTest() { |
|
23 var testFrame = document.getElementById('testFrame'); |
|
24 |
|
25 // Try a redirected load from another domain to this one. |
|
26 |
|
27 testFrame.onload = function() { |
|
28 // If properly redirected, we'll be able to access elements in the loaded |
|
29 // document. |
|
30 var item = testFrame.contentDocument.getElementById('testitem'); |
|
31 is(item.textContent, "testcontents", "Should be able to access the child document"); |
|
32 |
|
33 SimpleTest.finish(); |
|
34 } |
|
35 |
|
36 testFrame.src = "jar:http://example.org:80/tests/modules/libjar/test/mochitest/openredirect.sjs?http://mochi.test:8888/tests/modules/libjar/test/mochitest/bug403331.zip!/test.html"; |
|
37 } |
|
38 |
|
39 addLoadEvent(runTest); |
|
40 |
|
41 </script> |
|
42 </pre> |
|
43 |
|
44 </body> |
|
45 </html> |