Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / response-array-buffer-abort-in-loading-state.html
blob834cdede791cb5ed044f5aa75d72be76c3ab339e
1 <html>
2 <body>
3 <script src="/js-test-resources/js-test.js"></script>
4 <script type="text/javascript">
5 description("Test that if responseType is set to arraybuffer, " +
6 "XMLHttpRequest.response is null in DONE state, after abort()-ed " +
7 "in LOADING state.");
9 window.jsTestIsAsync = true;
11 var xhr = new XMLHttpRequest();
12 xhr.responseType = 'arraybuffer';
13 xhr.open('GET', '../resources/test.ogv', true);
14 xhr.onreadystatechange = function() {
15 if (this.readyState == this.LOADING) {
16 shouldBe("xhr.status", "200");
17 // readyState is not DONE.
18 shouldBe("xhr.response", "null");
19 xhr.abort();
20 } else if (this.readyState == this.DONE) {
21 // readyState is DONE but error flag is set.
22 shouldBe("xhr.response", "null");
23 finishJSTest();
26 xhr.send(null);
27 </script>
28 </body>