OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <title>Fetch: network timeout after receiving the HTTP response headers</tit
le> |
| 5 <script src="/resources/testharness.js"></script> |
| 6 <script src="/resources/testharnessreport.js"></script> |
| 7 <script src="../resources/utils.js"></script> |
| 8 </head> |
| 9 <body> |
| 10 <div id="log"></div> |
| 11 <script> |
| 12 function checkReader(test, reader, promiseToTest) |
| 13 { |
| 14 return reader.read().then((value) => { |
| 15 validateBufferFromString(value.value, "TEST_CHUNK", "Should receive firs
t chunk"); |
| 16 return promise_rejects(test, new TypeError(), promiseToTest(reader)); |
| 17 }); |
| 18 } |
| 19 |
| 20 promise_test((test) => { |
| 21 return fetch("../resources/bad-chunk-encoding.py?count=1").then((response) =
> { |
| 22 return checkReader(test, response.body.getReader(), reader => reader.rea
d()); |
| 23 }); |
| 24 }, "Response reader read() promise should reject after a network error happening
after resolving fetch promise"); |
| 25 |
| 26 promise_test((test) => { |
| 27 return fetch("../resources/bad-chunk-encoding.py?count=1").then((response) =
> { |
| 28 return checkReader(test, response.body.getReader(), reader => reader.clo
sed); |
| 29 }); |
| 30 }, "Response reader closed promise should reject after a network error happening
after resolving fetch promise"); |
| 31 </script> |
| 32 </body> |
| 33 </html> |
| 34 |
OLD | NEW |