mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
100
docshell/test/navigation/test_reserved.html
Normal file
100
docshell/test/navigation/test_reserved.html
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
<script type="text/javascript" src="NavigationUtils.js"></script>
|
||||
<style type="text/css">
|
||||
iframe { width: 90%; height: 200px; }
|
||||
</style>
|
||||
<script>
|
||||
if (navigator.platform.startsWith("Mac")) {
|
||||
SimpleTest.expectAssertions(0, 2);
|
||||
}
|
||||
|
||||
function testTop() {
|
||||
window0 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#top,location", "_blank", "width=10,height=10");
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isInaccessible(window0, "Should be able to navigate off-domain top by setting location.");
|
||||
window0.close();
|
||||
xpcCleanupWindows();
|
||||
|
||||
window1 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,open", "_blank", "width=10,height=10");
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isInaccessible(window1, "Should be able to navigate off-domain top by calling window.open.");
|
||||
window1.close();
|
||||
xpcCleanupWindows();
|
||||
|
||||
window2 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,form", "_blank", "width=10,height=10");
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isInaccessible(window2, "Should be able to navigate off-domain top by submitting form.");
|
||||
window2.close();
|
||||
xpcCleanupWindows();
|
||||
|
||||
window3 = window.open("iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_top,hyperlink", "_blank", "width=10,height=10");
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isInaccessible(window3, "Should be able to navigate off-domain top by targeted hyperlink.");
|
||||
window3.close();
|
||||
xpcCleanupWindows();
|
||||
|
||||
testParent();
|
||||
}, 1);
|
||||
}, 1);
|
||||
}, 1);
|
||||
}, 1);
|
||||
}
|
||||
|
||||
function testParent() {
|
||||
document.getElementById("frames").innerHTML = '<iframe src="iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#parent,location"></iframe>';
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isAccessible(frames[0], "Should not be able to navigate off-domain parent by setting location.");
|
||||
xpcCleanupWindows();
|
||||
|
||||
document.getElementById("frames").innerHTML = '<iframe src="iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_parent,open"></iframe>';
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isAccessible(frames[0], "Should not be able to navigate off-domain parent by calling window.open.");
|
||||
xpcCleanupWindows();
|
||||
|
||||
document.getElementById("frames").innerHTML = '<iframe src="iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_parent,form"></iframe>';
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isAccessible(frames[0], "Should not be able to navigate off-domain parent by submitting form.");
|
||||
xpcCleanupWindows();
|
||||
|
||||
document.getElementById("frames").innerHTML = '<iframe src="iframe.html#http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#_parent,hyperlink"></iframe>';
|
||||
|
||||
xpcWaitForFinishedFrames(function() {
|
||||
isAccessible(frames[0], "Should not be able to navigate off-domain parent by targeted hyperlink.");
|
||||
xpcCleanupWindows();
|
||||
|
||||
document.getElementById("frames").innerHTML = "";
|
||||
SimpleTest.finish();
|
||||
}, 1);
|
||||
}, 1);
|
||||
}, 1);
|
||||
}, 1);
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
testTop();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
|
||||
<div id="frames">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="text/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue