OLD | NEW |
---|---|
(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> | |
OLD | NEW |