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