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-basic-get-fail-non-simple.cgi", false);
19 log("FAIL: Exception thrown. Cross-domain access is not allowed in 'open'. [" + e
.message
+ "].");
23 // Non-whitelisted method
24 xhr
.setRequestHeader("x-webkit", "foobar");
26 // This is going to fail because the cgi script is not prepared for an OPTIONS request.
30 log("PASS: Exception thrown. Cross-domain access was denied in 'send'. [" + e
.message
+ "].");
34 log(xhr
.responseText
);