Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / xmlhttprequest-check-head-readystate-for-404.html
blob03e8e6e7f0d67fea444b75d67b38fd60b7f66bc7
1 <html>
2 <body>
3 <p>This tests the readyState of a XMLHttpRequset which is sent with a "HEAD" method to a not exist resource.</p>
4 <pre id="result">FAIL</pre>
5 <script type="text/javascript">
7 if (window.testRunner) {
8 testRunner.dumpAsText();
9 testRunner.waitUntilDone();
12 var res = "";
13 var xmlhttp = new XMLHttpRequest();
14 xmlhttp.onreadystatechange = function() {
15 if (xmlhttp.readyState) {
16 res = res + xmlhttp.readyState;
17 if(res == "124" && xmlhttp.status == 404) {
18 document.getElementById('result').innerText = "PASS";
20 if (window.testRunner)
21 testRunner.notifyDone();
26 xmlhttp.open("HEAD","notExist.html",true);
27 xmlhttp.send();
28 </script>
29 </body>
30 </html>