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("PUT", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-non-get-allow.cgi", false);
19 log("FAIL: Exception thrown. PUT cross-domain access is not allowed in 'open'. [" + e
.message
+ "].");
23 xhr
.setRequestHeader("Content-Type", "text/plain");
26 xhr
.send("PASS: PUT data received");
28 log("FAIL: Exception thrown. PUT cross-domain access is not allowed in 'send'. [" + e
.message
+ "].");
33 xhr
.open("PUT", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-non-get-allow.cgi", false);
35 log("FAIL: Exception thrown. GET cross-domain access is not allowed in 'open'. [" + e
.message
+ "].");
39 xhr
.setRequestHeader("Content-Type", "application/xml");
42 xhr
.send("FAIL: PUT data received");
43 log("FAIL: Exception not thrown. Cross-domain access was allowed, even though content type was not on white list.");
44 log(xhr
.responseText
);
46 log("PASS: Exception thrown. Cross-domain access is not allowed in 'send'. [" + e
.message
+ "].");