Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / workers / resources / access-control-preflight-request-headers-referer.js
blob929de2cd1512aea8160c279752af720c53295114
1 importScripts("worker-pre.js");
3 onmessage = function(event)
5 if (event.data == "START")
6 start();
9 function log(message)
11 postMessage("log " + message);
14 function done()
16 postMessage("DONE");
19 function start()
21 var xhr = new XMLHttpRequest();
22 xhr.open("GET", "http://localhost:8000/xmlhttprequest/workers/resources/access-control-preflight-request-headers-referer.php");
23 // Add a non-simple header to make CORS preflight happen.
24 xhr.setRequestHeader("X-Custom-Header", "PASS");
25 xhr.onerror = function () {
26 log("FAIL");
27 done();
29 xhr.onload = function () {
30 log(xhr.responseText);
31 done();
33 xhr.send();