Index: third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/error-after-response.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/error-after-response.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/error-after-response.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5701d6d7866b575dc162b27f70a336967c70911f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/error-after-response.html |
@@ -0,0 +1,34 @@ |
+<!doctype html> |
+<html> |
+ <head> |
+ <title>Fetch: network timeout after receiving the HTTP response headers</title> |
+ <script src="/resources/testharness.js"></script> |
+ <script src="/resources/testharnessreport.js"></script> |
+ <script src="../resources/utils.js"></script> |
+ </head> |
+ <body> |
+ <div id="log"></div> |
+ <script> |
+function checkReader(test, reader, promiseToTest) |
+{ |
+ return reader.read().then((value) => { |
+ validateBufferFromString(value.value, "TEST_CHUNK", "Should receive first chunk"); |
+ return promise_rejects(test, new TypeError(), promiseToTest(reader)); |
+ }); |
+} |
+ |
+promise_test((test) => { |
+ return fetch("../resources/bad-chunk-encoding.py?count=1").then((response) => { |
+ return checkReader(test, response.body.getReader(), reader => reader.read()); |
+ }); |
+}, "Response reader read() promise should reject after a network error happening after resolving fetch promise"); |
+ |
+promise_test((test) => { |
+ return fetch("../resources/bad-chunk-encoding.py?count=1").then((response) => { |
+ return checkReader(test, response.body.getReader(), reader => reader.closed); |
+ }); |
+}, "Response reader closed promise should reject after a network error happening after resolving fetch promise"); |
+ </script> |
+ </body> |
+</html> |
+ |