Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/request-from-popup.html

Issue 1745083002: CORS-RFC1918: Force preflights for external requests in DocumentThreadableLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html><body> 1 <html><body>
2 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=4343">bug 4343</a>: 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> 3 XMLHttpRequest doesn't work in a JavaScript-created window.</p>
4 <p id=result>FAIL</p> 4 <p id=result>FAIL</p>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 if (window.testRunner) { 6 if (window.testRunner) {
7 testRunner.dumpAsText(); 7 testRunner.dumpAsText();
8 testRunner.setCanOpenWindows(); 8 testRunner.setCanOpenWindows();
9 testRunner.waitUntilDone(); 9 testRunner.waitUntilDone();
10 } 10 }
11 11
12 winRef=window.open(); 12 winRef=window.open();
13 if (!winRef) 13 if (!winRef)
14 alert("Popup window could not be opened, please disable pop-up blocker"); 14 alert("Popup window could not be opened, please disable pop-up blocker");
15 15
16 winRef.document.writeln("<html><body><script type='text/javascript'>"); 16 winRef.document.writeln("<html><body><script type='text/javascript'>");
17 winRef.document.writeln("var req = new XMLHttpRequest();"); 17 winRef.document.writeln("var req = new XMLHttpRequest();");
18 winRef.document.writeln("req.onreadystatechange = result;"); 18 winRef.document.writeln("req.onreadystatechange = result;");
19 winRef.document.writeln("req.open('GET', 'request-from-popup.html', true);"); 19 winRef.document.writeln("req.open('GET','/xmlhttprequest/resources/access-contro l-basic-allow-access-control-origin-header.cgi', true);");
20 winRef.document.writeln("req.send(null);"); 20 winRef.document.writeln("req.send(null);");
21 winRef.document.writeln("function result() { if (req.readyState == 4) { opener.d ocument.getElementById('result').innerHTML='SUCCESS'; if (opener.testRunner) ope ner.testRunner.notifyDone(); window.close(); } }"); 21 winRef.document.writeln("function result() { if (req.readyState == 4) { opener.d ocument.getElementById('result').innerHTML='SUCCESS'; if (opener.testRunner) ope ner.testRunner.notifyDone(); window.close(); } }");
22 winRef.document.writeln("<\/script><\/body><\/html>"); 22 winRef.document.writeln("<\/script><\/body><\/html>");
23 winRef.document.close(); 23 winRef.document.close();
24 </script></body></html> 24 </script></body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698