| <script type="text/javascript"> |
| document.getElementById('console').appendChild(document.createTextNode(message + "\n")); |
| var xhr = new XMLHttpRequest; |
| xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi", false); |
| log("FAIL: Exception thrown. Cross-domain access is not allowed in 'open'. [" + e.message + "]."); |
| // Non-whitelisted method |
| xhr.setRequestHeader("x-webkit", "foobar"); |
| // This is going to fail because the cgi script is not prepared for an OPTIONS request. |
| log("PASS: Exception thrown. Cross-domain access was denied in 'send'. [" + e.message + "]."); |