OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 </head> |
| 5 <body> |
| 6 <script src="/js-test-resources/js-test.js"></script> |
| 7 <script> |
| 8 description("Request a file as the Text type with asynchronous XMLHttpRequest in
a document context."); |
| 9 window.jsTestIsAsync = true; |
| 10 document.body.onload = function() { |
| 11 var xhr = new XMLHttpRequest(); |
| 12 xhr.open('GET', 'resources/test.html?0'); |
| 13 xhr.send(); |
| 14 xhr.onreadystatechange = function() { |
| 15 if (xhr.readyState === 4) { |
| 16 debug('xhr.readyState === 4'); |
| 17 } |
| 18 }; |
| 19 |
| 20 xhr.onerror = function() { |
| 21 debug('FAIL0: onerror'); |
| 22 finishJSTest(); |
| 23 }; |
| 24 xhr.onabort = function() { |
| 25 debug('FAIL0: onabort'); |
| 26 finishJSTest(); |
| 27 }; |
| 28 xhr.ontimeout = function() { |
| 29 deubg('FAIL0: ontimeout'); |
| 30 finishJSTest(); |
| 31 }; |
| 32 |
| 33 xhr.onload = function() { |
| 34 debug('xhr.onload'); |
| 35 debug(s[xhr.readyState] === ' ' ? 'DONE' : 'FAIL'); |
| 36 finishJSTest(); |
| 37 }; |
| 38 }; |
| 39 var s = 'I do not know why, but declaring this variable causes timeout.'; |
| 40 </script> |
| 41 </body> |
| 42 </html> |
OLD | NEW |