blob: 5d6c45bdb9f6dc0c7b3f07f104952d11f5e807bd [file] [log] [blame]
<html><body>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=4343">bug 4343</a>:
XMLHttpRequest doesn't work in a JavaScript-created window.</p>
<p id=result>FAIL</p>
<script type="text/javascript">
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.setCanOpenWindows();
testRunner.waitUntilDone();
}
winRef=window.open();
if (!winRef)
alert("Popup window could not be opened, please disable pop-up blocker");
winRef.document.writeln("<html><body><script type='text/javascript'>");
winRef.document.writeln("var req = new XMLHttpRequest();");
winRef.document.writeln("req.onreadystatechange = result;");
winRef.document.writeln("req.open('GET', 'request-from-popup.html', true);");
winRef.document.writeln("req.send(null);");
winRef.document.writeln("function result() { if (req.readyState == 4) { opener.document.getElementById('result').innerHTML='SUCCESS'; if (opener.testRunner) opener.testRunner.notifyDone(); window.close(); } }");
winRef.document.writeln("<\/script><\/body><\/html>");
winRef.document.close();
</script></body></html>