Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-basic-allow-access-control-origin-header-data-url.html
blob91c6537061d292aecc237bd9af16b58f16c64707
1 <html>
2 <body>
3 <pre id='console'></pre>
4 <script type="text/javascript">
5 function log(message)
7 document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
10 if (window.testRunner) {
11 testRunner.dumpAsText();
12 testRunner.waitUntilDone();
15 window.addEventListener("message", function(evt) {
16 if (evt.data == "done") {
17 testRunner.notifyDone();
18 return;
21 log(evt.data);
22 }, false);
23 </script>
24 <iframe src='data:text/html,
25 <script>
26 (function() {
27 var xhr = new XMLHttpRequest;
29 try {
30 xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-access-control-origin-header.cgi", false);
31 } catch(e) {
32 parent.postMessage("FAIL: Exception thrown. Cross-domain access is not allowed in open. [" + e.message + "].", "*");
33 return;
36 try {
37 xhr.send();
38 } catch(e) {
39 parent.postMessage("FAIL: Exception thrown. Cross-domain access is not allowed in send. [" + e.message + "].", "*");
40 return;
43 parent.postMessage(xhr.responseText, "*");
44 })();
45 parent.postMessage("done", "*");
46 </script>'>
47 </body>
48 </html>