| <html> |
| <body> |
| <p>Tests for <a href="http://bugs.webkit.org/show_bug.cgi?id=3420">bug 3420</a>: |
| XMLHttpRequest does not handle set-cookie headers.</p> |
| <div id="result">FAIL: test script didn't run.</div> |
| |
| <script> |
| if (window.layoutTestController) |
| layoutTestController.dumpAsText(); |
| |
| try { |
| |
| req = new XMLHttpRequest; |
| req.open("POST", "resources/get-set-cookie.cgi", false); |
| req.send(""); |
| if (req.responseText && req.responseText.match(/.*WK-test=1.*/)) { |
| document.getElementById("result").firstChild.data = "FAIL: the cookie is already present. Please restart your browser to remove it."; |
| } else { |
| req.open("POST", "resources/get-set-cookie.cgi", false); |
| req.send(""); |
| if (req.responseText.match(/.*WK-test-secure=1.*/)) |
| document.getElementById("result").firstChild.data = "FAIL: a secure cookie was sent via HTTP"; |
| else if (req.responseText.match(/.*WK-test=1.*/)) |
| document.getElementById("result").firstChild.data = "SUCCESS"; |
| else |
| document.getElementById("result").firstChild.data = "FAIL: the cookie was not set"; |
| } |
| } catch (ex) { |
| document.getElementById("result").firstChild.data = ex; |
| } |
| </script> |
| <body> |
| </html> |