| <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=11611">bug 11611</a>: |
| REGRESSION: No http referer header sent on XMLHttpRequest.</p> |
| <div id=sync>sync: </div> |
| <div id=async>async: </div> |
| if (window.layoutTestController) { |
| layoutTestController.dumpAsText(); |
| layoutTestController.waitUntilDone(); |
| req = new XMLHttpRequest; |
| req.open("GET", "resources/print-referer.cgi", false); |
| if (req.responseText == document.URL) |
| document.getElementById("sync").firstChild.data += "OK"; |
| document.getElementById("sync").firstChild.data += req.responseText; |
| req.open("GET", "resources/print-referer.cgi", true); |
| req.onreadystatechange = processStateChange; |
| function processStateChange() { |
| if (req.readyState == 4) { |
| if (req.responseText == document.URL) |
| document.getElementById("async").firstChild.data += "OK"; |
| document.getElementById("async").firstChild.data += req.responseText; |
| if (window.layoutTestController) |
| layoutTestController.notifyDone(); |