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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <title>trailer() test</title>
3 <script src=/resources/testharness.js></script>
4 <script src=/resources/testharnessreport.js></script>
5 <div id=log></div>
6 <!-- based on /XMLHttpRequest/getresponseheader-chunked-trailer.htm -->
7 <script>
8 promise_test(() => {
9 return fetch("/XMLHttpRequest/resources/chunked.py").then(res => {
10 assert_equals(res.headers.get("Trailer"), "X-Test-Me")
11 assert_equals(res.headers.get("X-Test-Me"), null)
12 assert_equals(res.headers.get("Content-Type"), "text/plain")
13 return Promise.all([
14 res.text().then(text => {
15 assert_equals(text, "First chunk\r\nSecond chunk\r\nYet another (third) chunk\r\nYet another (fourth) chunk\r\n")
16 }),
17 res.trailer.then(trailers => {
18 assert_equals(trailers.get("X-Test-Me"), "Trailer header value")
19 assert_throws(new TypeError, () => trailers.append("Immutable-My-Ass", " Hi!"))
20 })
21 ])
22 })
23 })
24 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698