3 <pre id='console'
></pre>
4 <script type=
"text/javascript">
7 document
.getElementById('console').appendChild(document
.createTextNode(message
+ "\n"));
10 if (window
.testRunner
)
11 testRunner
.dumpAsText();
14 var xhr
= new XMLHttpRequest();
17 xhr
.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-denied-xsrf.php?state=reset", false);
20 log("FAIL: Unable to reset server state: [" + e
.message
+ "].");
24 xhr
= new XMLHttpRequest();
27 xhr
.open("DELETE", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-denied-xsrf.php?state=method", false);
29 log("FAIL: Exception thrown. Cross-domain access is not allowed in first 'open'. [" + e
.message
+ "].");
35 log("FAIL: Cross-domain access allowed in first send without throwing an exception");
41 xhr
= new XMLHttpRequest();
44 xhr
.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-preflight-denied-xsrf.php?state=complete", false);
46 log("FAIL: Exception thrown. Cross-domain access is not allowed in second 'open'. [" + e
.message
+ "].");
53 log("FAIL: Exception thrown. Cross-domain access is not allowed in second 'send'. [" + e
.message
+ "].");
57 log(xhr
.responseText
);