| <script type="text/javascript"> |
| document.getElementById('console').appendChild(document.createTextNode(message + "\n")); |
| testRunner.waitUntilDone(); |
| var xhr = new XMLHttpRequest(); |
| xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-denied-xsrf.php?test=access-control-preflight-async-non-supported&state=reset", false); |
| log("FAIL: Unable to reset server state: [" + e.message + "]."); |
| xhr = new XMLHttpRequest(); |
| xhr.open("PUT", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-denied-xsrf.php?test=access-control-preflight-async-non-supported", true); |
| log("FAIL: Exception thrown. Cross-domain access is not allowed in first 'open'. [" + e.message + "]."); |
| xhr.onerror = function() { |
| xhr = new XMLHttpRequest(); |
| xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-denied-xsrf.php?test=access-control-preflight-async-non-supported&state=complete", false); |
| log("FAIL: Exception thrown. Cross-domain access is not allowed in second 'send'. [" + e.message + "]."); |
| log("FAIL: Exception thrown. Cross-domain access is not allowed in second 'open'. [" + e.message + "]."); |
| xhr.onreadystatechange = function() { |
| if (xhr.readyState == 4 && xhr.status == 200) |
| log("FAIL: Cross-domain access allowed in first send without throwing an exception"); |