blob: 7acf8c071b45d64f1d93a94945225922b3534cdb [file] [log] [blame]
<script>
(function() {
if (location.hash == "#stop")
return;
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
testRunner.setCanOpenWindows();
testRunner.setCloseRemainingWindowsWhenComplete(true);
}
blankWindow = open(location + "#stop");
blankWindow.onload = function() {
blankFunc = blankWindow.Function;
blankWindow.opener = null;
blankWindow.eval("location = 'about:blank'");
setTimeout(function() {
try {
blankFunc = blankFunc("return window.Function")();
} catch (e) {
blankFunc = false;
}
if (!blankFunc && window.testRunner) {
testRunner.notifyDone()
return;
}
blankFunc("alertFunc", "(" + function() {
targetWindow = open("http://localhost:8080/security/resources/post-done-to-opener.html");
targetFunc = targetWindow.Function;
this.alertFunc = alertFunc;
targetWindow.addEventListener("load", function() {
alertFunc(targetFunc("return document.documentElement.innerHTML")());
});
} + ")()")( function(s) { alert(s) });
}, 0);
}
window.addEventListener('message', function(evt) {
if (evt.data == 'done') {
if (window.testRunner)
testRunner.notifyDone();
}
});
})();
</script>
This test passes if it doesn't alert something ugly.