Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / access-control-response-with-body.html
blob0ec2604b7c87a0adafdf60e1930a34cfe7a81fcd
1 <html>
2 <body>
3 <p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=36854">bug 36854<a>:
4 Body from cross origin preflight response is prepended to the actual response body.</p>
5 <div id=result>Running test...</div>
6 <script>
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.waitUntilDone();
13 window.onload = function() {
14 var xhr = new XMLHttpRequest();
15 xhr.onreadystatechange=function() {
16 if (xhr.readyState==4) {
17 document.getElementById("result").innerHTML = (xhr.responseText == "echo") ? "PASS" : ("FAIL: " + xhr.responseText);
18 if (window.testRunner)
19 testRunner.notifyDone();
23 xhr.open("GET","http://localhost:8000/xmlhttprequest/resources/access-control-allow-with-body.php");
24 xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
25 xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
26 xhr.send(null);
29 </script>
31 </body>
32 </html>