OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <body> | 3 <body> |
4 <p>Test the behavior of a sync XMLHttpRequest that encounters an infinite redire
ction loop.</p> | 4 <p>Test the behavior of a sync XMLHttpRequest that encounters an infinite redire
ction loop.</p> |
5 <script> | 5 <script> |
6 | 6 |
7 if (window.testRunner) | 7 if (window.testRunner) |
8 testRunner.dumpAsText(); | 8 testRunner.dumpAsText(); |
9 | 9 |
10 try { | 10 try { |
11 if (window.XMLHttpRequest) { | 11 if (window.XMLHttpRequest) { |
12 req = new XMLHttpRequest(); | 12 req = new XMLHttpRequest(); |
13 } else { | 13 } else { |
14 try { | 14 try { |
15 req = new ActiveXObject("Msxml2.XMLHTTP"); | 15 req = new ActiveXObject("Msxml2.XMLHTTP"); |
16 } catch (ex) { | 16 } catch (ex) { |
17 req = new ActiveXObject("Microsoft.XMLHTTP"); | 17 req = new ActiveXObject("Microsoft.XMLHTTP"); |
18 } | 18 } |
19 } | 19 } |
20 | 20 |
21 req.open('GET', 'resources/infinite-loop.php', false); | 21 req.open('GET', 'resources/infinite-loop.php', false); |
| 22 req.onreadystatechange = function() |
| 23 { |
| 24 document.write('onreadystatechange is invoked unexpectedly<br>'); |
| 25 } |
| 26 req.onerror = function() |
| 27 { |
| 28 document.write('onerror is invoked unexpectedly<br>'); |
| 29 } |
22 req.send(null); | 30 req.send(null); |
23 | 31 |
24 document.write("Status: " + req.status); | 32 document.write("Status: " + req.status); |
25 | 33 |
26 } catch (ex) { | 34 } catch (ex) { |
27 document.write("Exception " + ex.name + "; code=" + ex.code + "; number=
" + ex.number + " (" + (ex.number & 0xFFFF) + "); message='" + ex.message + "'")
; | 35 document.write("Exception " + ex.name + "; code=" + ex.code + "; number=
" + ex.number + " (" + (ex.number & 0xFFFF) + "); message='" + ex.message + "'")
; |
28 } | 36 } |
29 | 37 |
30 </script> | 38 </script> |
31 </body> | 39 </body> |
32 </html> | 40 </html> |
OLD | NEW |