Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / request-from-popup.html
blob5d6c45bdb9f6dc0c7b3f07f104952d11f5e807bd
1 <html><body>
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>
4 <p id=result>FAIL</p>
5 <script type="text/javascript">
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.setCanOpenWindows();
9 testRunner.waitUntilDone();
12 winRef=window.open();
13 if (!winRef)
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>