| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <body> | 2 <body> |
| 3 <script src="/js-test-resources/js-test-pre.js"></script> | 3 <script src="/js-test-resources/js-test-pre.js"></script> |
| 4 <script type="text/javascript"> | 4 <script type="text/javascript"> |
| 5 description("Test that if responseType is set to arraybuffer, " + | 5 description("Test that if responseType is set to arraybuffer, " + |
| 6 "XMLHttpRequest.response is null in DONE state, after abort()-ed " + | 6 "XMLHttpRequest.response is null in DONE state, after abort()-ed " + |
| 7 "in LOADING state."); | 7 "in LOADING state."); |
| 8 | 8 |
| 9 window.jsTestIsAsync = true; | 9 window.jsTestIsAsync = true; |
| 10 | 10 |
| 11 var xhr = new XMLHttpRequest(); | 11 var xhr = new XMLHttpRequest(); |
| 12 xhr.responseType = 'arraybuffer'; | 12 xhr.responseType = 'arraybuffer'; |
| 13 xhr.open('GET', '../resources/test.ogv', true); | 13 xhr.open('GET', '../resources/test.ogv', true); |
| 14 xhr.onreadystatechange = function() { | 14 xhr.onreadystatechange = function() { |
| 15 if (this.readyState == this.LOADING) { | 15 if (this.readyState == this.LOADING) { |
| 16 shouldBe("xhr.status", "200"); | 16 shouldBe("xhr.status", "200"); |
| 17 // readyState is not DONE. | 17 // readyState is not DONE. |
| 18 shouldBe("xhr.response", "null"); | 18 shouldBe("xhr.response", "null"); |
| 19 xhr.abort(); | 19 xhr.abort(); |
| 20 } else if (this.readyState == this.DONE) { | 20 } else if (this.readyState == this.DONE) { |
| 21 // readyState is DONE but error flag is set. | 21 // readyState is DONE but error flag is set. |
| 22 shouldBe("xhr.response", "null"); | 22 shouldBe("xhr.response", "null"); |
| 23 finishJSTest(); | 23 finishJSTest(); |
| 24 } | 24 } |
| 25 }; | 25 }; |
| 26 xhr.send(null); | 26 xhr.send(null); |
| 27 </script> | 27 </script> |
| 28 <script src="/js-test-resources/js-test-post.js"></script> | |
| 29 </body> | 28 </body> |
| OLD | NEW |