| OLD | NEW |
| 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> |
| OLD | NEW |