Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / connection-error-sync.html
blobfad290524dc21258637e70b4b17227be0407ba67
1 <html>
2 <head>
3 <body>
4 <p>Test the behavior of a sync XMLHttpRequest that encounters an infinite redirection loop.</p>
5 <script>
7 if (window.testRunner)
8 testRunner.dumpAsText();
10 try {
11 if (window.XMLHttpRequest) {
12 req = new XMLHttpRequest();
13 } else {
14 try {
15 req = new ActiveXObject("Msxml2.XMLHTTP");
16 } catch (ex) {
17 req = new ActiveXObject("Microsoft.XMLHTTP");
21 req.open('GET', 'resources/infinite-loop.php', false);
22 req.onreadystatechange = function()
24 document.write('onreadystatechange is invoked unexpectedly<br>');
26 req.onerror = function()
28 document.write('onerror is invoked unexpectedly<br>');
30 req.send(null);
32 document.write("Status: " + req.status);
34 } catch (ex) {
35 document.write("Exception " + ex.name + "; code=" + ex.code + "; number=" + ex.number + " (" + (ex.number & 0xFFFF) + "); message='" + ex.message + "'");
38 </script>
39 </body>
40 </html>