Mozilla/mozilla/content/base/test/file_bug326337_inner.html
bzbarsky%mit.edu 2f524bf71f Fix the test: off-domain subframes can no longer change the location of a
non-toplevel parent frame, with the checkin for bug 408052.


git-svn-id: svn://10.0.0.236/trunk@244159 18797224-902f-48f8-a5cc-f745e15eee43
2008-01-27 21:00:13 +00:00

60 lines
1.1 KiB
HTML

<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=326337
-->
<head>
<title>Inner file for Bug 326337</title>
</head>
<body>
<script>
document.domain = "example.com";
runTest1();
var xhr;
function runTest1() {
xhr = new XMLHttpRequest();
xhr.open("GET", "file_bug326337.xml", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
check(xhr.responseXML.documentElement.getAttribute("root"));
runTest2();
}
}
xhr.send(null);
}
function runTest2() {
var secondDoc = false;
xhr = new XMLHttpRequest();
xhr.multipart = true;
xhr.open("GET", "file_bug326337_multipart.txt", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
check(xhr.responseXML.documentElement.getAttribute("root"));
if (secondDoc) {
parent.location.hash = "#done";
}
else {
secondDoc = true;
}
}
}
xhr.send(null);
}
function check(attr) {
if (attr != "yes") {
parent.location.hash = "#fail";
throw 1;
}
}
</script>
</pre>
</body>
</html>