OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
| 3 <title>Test that XMLHttpRequest.response returns an empty ArrayBuffer when recei
ved a response without an entity body.</title> |
3 <script src="../resources/testharness.js"></script> | 4 <script src="../resources/testharness.js"></script> |
4 <script src="../resources/testharnessreport.js"></script> | 5 <script src="../resources/testharnessreport.js"></script> |
5 <p>Test that XMLHttpRequest.response returns an empty ArrayBuffer when received
a response without an entity body.</p> | |
6 <pre id="console"></pre> | |
7 <script> | 6 <script> |
8 | 7 |
9 var zeroContentLengthTest = async_test("Test that XMLHttpRequest.response return
s an empty ArrayBuffer when received a response with zero content length."); | 8 var zeroContentLengthTest = async_test("Test that XMLHttpRequest.response return
s an empty ArrayBuffer when received a response with zero content length."); |
10 zeroContentLengthTest.step(function() { | 9 zeroContentLengthTest.step(function() { |
11 var req = new XMLHttpRequest; | 10 var req = new XMLHttpRequest; |
12 req.responseType = 'arraybuffer'; | 11 req.responseType = 'arraybuffer'; |
13 req.open('GET', 'resources/zero-length.xml', true); | 12 req.open('GET', 'resources/zero-length.xml', true); |
14 req.onreadystatechange = zeroContentLengthTest.step_func(function() { | 13 req.onreadystatechange = zeroContentLengthTest.step_func(function() { |
15 if (req.readyState != 4) | 14 if (req.readyState != 4) |
16 return; | 15 return; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 assert_equals(req2.response.byteLength, 0); | 51 assert_equals(req2.response.byteLength, 0); |
53 notModifiedTest.done(); | 52 notModifiedTest.done(); |
54 }); | 53 }); |
55 req2.send(null); | 54 req2.send(null); |
56 }); | 55 }); |
57 req.send(null); | 56 req.send(null); |
58 }); | 57 }); |
59 | 58 |
60 </script> | 59 </script> |
61 </body> | 60 </body> |
OLD | NEW |