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