OLD | NEW |
(Empty) | |
| 1 importScripts('worker-test-helpers.js'); |
| 2 |
| 3 test(function() { |
| 4 var headers = new HeaderMap; |
| 5 headers.set('Content-Language', 'ja'); |
| 6 headers.set('Content-Type', 'text/html; charset=UTF-8'); |
| 7 headers.set('X-ServiceWorker-Test', 'response test field'); |
| 8 |
| 9 var response = new Response({ |
| 10 status: 303, |
| 11 statusText: 'See Other', |
| 12 headers: headers |
| 13 }); |
| 14 |
| 15 assert_equals(response.status, 303, 'Response.status should match'); |
| 16 assert_equals(response.statusText, 'See Other', 'Response.statusText should
match'); |
| 17 assert_true(response.headers instanceof HeaderMap, 'Response.headers should
be HeaderMap'); |
| 18 assert_equals(response.headers.size, 3, 'Response.headers.size should match'
); |
| 19 // Note: detailed behavioral tests for HeaderMap are in another test, |
| 20 // http/tests/serviceworker/headermap.html. |
| 21 |
| 22 }, 'Response in ServiceWorkerGlobalScope'); |
OLD | NEW |