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() | 22 req.onreadystatechange = function() |
23 { | 23 { |
24 document.write('onreadystatechange is invoked unexpectedly<br>'); | 24 document.write('onreadystatechange is invoked unexpectedly<br>'); |
25 } | 25 } |
26 req.onerror = function() | 26 req.onerror = function() |
27 { | 27 { |
28 document.write('onerror is invoked unexpectedly<br>'); | 28 document.write('onerror is invoked unexpectedly<br>'); |
29 } | 29 } |
30 req.send(null); | 30 req.send(null); |
31 | 31 |
32 document.write("Status: " + req.status); | 32 document.write("Status: " + req.status); |
33 | 33 |
34 } catch (ex) { | 34 } catch (ex) { |
35 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 + "'")
; |
36 } | 36 } |
37 | 37 |
38 </script> | 38 </script> |
39 </body> | 39 </body> |
40 </html> | 40 </html> |
OLD | NEW |