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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/window/useragent-header.html

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 4 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 <script src = "/resources/testharness.js"></script>
3 <script src = "/resources/testharnessreport.js"></script>
4 <script src = "../resources/useragent-header.js"></script>
5 <script>
6 promise_test(() => {
7 return fetch('/resources/echo-headers.php')
8 .then(response => {
horo 2016/08/24 01:38:33 ditto
9 return response.text();
10 }).then(body => {
11 const user_agent_header = parse_response(body);
12 assert_true(user_agent_header.length > 0);
13 });
14 }, 'fetch() should send a non-empty User-Agent header');
15
16 promise_test(() => {
17 return fetch('/resources/echo-headers.php', {headers: {'user-agent': 'foobar'} })
18 .then(response => {
horo 2016/08/24 01:38:33 ditto
19 return response.text();
20 }).then(body => {
21 const user_agent_header = parse_response(body);
22 assert_equals(user_agent_header, 'foobar');
23 });
24 }, 'fetch() should send an author provided User-Agent header');
25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698