Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1423)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/error-after-response.html

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>
+

Powered by Google App Engine
This is Rietveld 408576698