|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
7 <script type="text/javascript" src="NavigationUtils.js"></script> |
|
8 <style type="text/css"> |
|
9 iframe { width: 90%; height: 50px; } |
|
10 </style> |
|
11 <script> |
|
12 window.onload = function () { |
|
13 navigateByLocation(window0.frames[0]); |
|
14 navigateByOpen("window1_child0"); |
|
15 navigateByForm("window2_child0"); |
|
16 navigateByHyperlink("window3_child0"); |
|
17 |
|
18 xpcWaitForFinishedFrames(function() { |
|
19 isInaccessible(window0.frames[0], "Should not be able to navigate off-domain frame by setting location."); |
|
20 isInaccessible(window1.frames[0], "Should not be able to navigate off-domain frame by calling window.open."); |
|
21 isInaccessible(window2.frames[0], "Should not be able to navigate off-domain frame by submitting form."); |
|
22 isInaccessible(window3.frames[0], "Should not be able to navigate off-domain frame by targeted hyperlink."); |
|
23 |
|
24 window0.close(); |
|
25 window1.close(); |
|
26 window2.close(); |
|
27 window3.close(); |
|
28 |
|
29 xpcCleanupWindows(); |
|
30 SimpleTest.finish(); |
|
31 }, 4); |
|
32 } |
|
33 |
|
34 var window0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window0", "width=10,height=10"); |
|
35 var window1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window1", "width=10,height=10"); |
|
36 var window2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window2", "width=10,height=10"); |
|
37 var window3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/parent.html", "window3", "width=10,height=10"); |
|
38 </script> |
|
39 </head> |
|
40 <body> |
|
41 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=13871">Mozilla Bug 13871</a> |
|
42 <pre id="test"> |
|
43 <script type="text/javascript"> |
|
44 SimpleTest.waitForExplicitFinish(); |
|
45 </script> |
|
46 </pre> |
|
47 </body> |
|
48 </html> |