Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / response-blob-abort-in-loading-state.html
blob8270d4084147caa3067839d4b984542ff20b3b2a
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 = 'blob';
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>