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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-basic-allow-access-control-origin-header-data-url.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> 1 <html>
2 <body> 2 <body>
3 <pre id='console'></pre> 3 <pre id='console'></pre>
4 <script type="text/javascript"> 4 <script type="text/javascript">
5 function log(message) 5 function log(message)
6 { 6 {
7 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n")); 7 document.getElementById('console').appendChild(document.createTextNode(messa ge + "\n"));
8 } 8 }
9 9
10 if (window.testRunner) { 10 if (window.testRunner) {
11 testRunner.dumpAsText(); 11 testRunner.dumpAsText();
12 testRunner.waitUntilDone(); 12 testRunner.waitUntilDone();
13 } 13 }
14 14
15 window.addEventListener("message", function(evt) { 15 window.addEventListener("message", function(evt) {
16 if (evt.data == "done") { 16 if (evt.data == "done") {
17 testRunner.notifyDone(); 17 testRunner.notifyDone();
18 return; 18 return;
19 } 19 }
20 20
21 log(evt.data); 21 log(evt.data);
22 }, false); 22 }, false);
23 </script> 23 </script>
24 <iframe src='data:text/html, 24 <iframe src='data:text/html,
25 <script> 25 <script>
26 (function() { 26 (function() {
27 var xhr = new XMLHttpRequest; 27 var xhr = new XMLHttpRequest;
28 28
29 try { 29 try {
30 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-c ontrol-basic-allow-access-control-origin-header.cgi", false); 30 xhr.open("GET", "http://example.test:8000/xmlhttprequest/resources/acces s-control-basic-allow-access-control-origin-header.cgi", false);
31 } catch(e) { 31 } catch(e) {
32 parent.postMessage("FAIL: Exception thrown. Cross-domain access is not a llowed in open. [" + e.message + "].", "*"); 32 parent.postMessage("FAIL: Exception thrown. Cross-domain access is not a llowed in open. [" + e.message + "].", "*");
33 return; 33 return;
34 } 34 }
35 35
36 try { 36 try {
37 xhr.send(); 37 xhr.send();
38 } catch(e) { 38 } catch(e) {
39 parent.postMessage("FAIL: Exception thrown. Cross-domain access is not a llowed in send. [" + e.message + "].", "*"); 39 parent.postMessage("FAIL: Exception thrown. Cross-domain access is not a llowed in send. [" + e.message + "].", "*");
40 return; 40 return;
41 } 41 }
42 42
43 parent.postMessage(xhr.responseText, "*"); 43 parent.postMessage(xhr.responseText, "*");
44 })(); 44 })();
45 parent.postMessage("done", "*"); 45 parent.postMessage("done", "*");
46 </script>'> 46 </script>'>
47 </body> 47 </body>
48 </html> 48 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698