2 <p>Test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=4343">bug
4343</a>:
3 XMLHttpRequest doesn't work in a JavaScript-created window.
</p>
5 <script type=
"text/javascript">
6 if (window
.testRunner
) {
7 testRunner
.dumpAsText();
8 testRunner
.setCanOpenWindows();
9 testRunner
.waitUntilDone();
14 alert("Popup window could not be opened, please disable pop-up blocker");
16 winRef
.document
.writeln("<html><body><script type='text/javascript'>");
17 winRef
.document
.writeln("var req = new XMLHttpRequest();");
18 winRef
.document
.writeln("req.onreadystatechange = result;");
19 winRef
.document
.writeln("req.open('GET', 'request-from-popup.html', true);");
20 winRef
.document
.writeln("req.send(null);");
21 winRef
.document
.writeln("function result() { if (req.readyState == 4) { opener.document.getElementById('result').innerHTML='SUCCESS'; if (opener.testRunner) opener.testRunner.notifyDone(); window.close(); } }");
22 winRef
.document
.writeln("<\/script><\/body><\/html>");
23 winRef
.document
.close();
24 </script></body></html>