1 importScripts("worker-pre.js");
3 onmessage = function(event
)
5 if (event
.data
== "START")
11 postMessage("log " + message
);
22 var xhr
= new XMLHttpRequest
;
23 xhr
.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi", false);
25 log("PASS: Cross-domain access allowed for simple get.");
27 log("FAIL: Exception thrown. Cross-domain access is not allowed in 'open'. [" + e
.message
+ "].");
31 // This is going to fail because the cgi script is not prepared for an OPTIONS request.
33 var xhr
= new XMLHttpRequest
;
34 xhr
.open("GET", "http://localhost:8000/xmlhttprequest/resources/access-control-basic-get-fail-non-simple.cgi", false);
35 // Non-whitelisted method
36 xhr
.setRequestHeader("x-webkit", "foobar");
39 log("PASS: Exception thrown. Cross-domain access was denied in 'send'. [" + e
.message
+ "].");