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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.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/response/response-trailer.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html
new file mode 100644
index 0000000000000000000000000000000000000000..5454040a35632e966db59b486a267a05e8ecaf57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html
@@ -0,0 +1,24 @@
+<!doctype html>
+<title>trailer() test</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<div id=log></div>
+<!-- based on /XMLHttpRequest/getresponseheader-chunked-trailer.htm -->
+<script>
+promise_test(() => {
+ return fetch("/XMLHttpRequest/resources/chunked.py").then(res => {
+ assert_equals(res.headers.get("Trailer"), "X-Test-Me")
+ assert_equals(res.headers.get("X-Test-Me"), null)
+ assert_equals(res.headers.get("Content-Type"), "text/plain")
+ return Promise.all([
+ res.text().then(text => {
+ assert_equals(text, "First chunk\r\nSecond chunk\r\nYet another (third) chunk\r\nYet another (fourth) chunk\r\n")
+ }),
+ res.trailer.then(trailers => {
+ assert_equals(trailers.get("X-Test-Me"), "Trailer header value")
+ assert_throws(new TypeError, () => trailers.append("Immutable-My-Ass", "Hi!"))
+ })
+ ])
+ })
+})
+</script>

Powered by Google App Engine
This is Rietveld 408576698