| OLD | NEW |
| 1 if (self.importScripts) { | 1 if (self.importScripts) { |
| 2 importScripts('../resources/fetch-test-helpers.js'); | 2 importScripts('../resources/fetch-test-helpers.js'); |
| 3 } | 3 } |
| 4 | 4 |
| 5 test(function() { | 5 test(function() { |
| 6 var expectedValueMap = { | 6 var expectedValueMap = { |
| 7 'content-language': 'ja', | 7 'content-language': 'ja', |
| 8 'content-type': 'text/html; charset=UTF-8', | 8 'content-type': 'text/html; charset=UTF-8', |
| 9 'x-fetch-test': 'response test field' | 9 'x-fetch-test': 'response test field' |
| 10 }; | 10 }; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 function() { var headers = new Headers([['a', 'b'], []]); }, | 214 function() { var headers = new Headers([['a', 'b'], []]); }, |
| 215 'new Headers with a sequence with less than two strings ' + | 215 'new Headers with a sequence with less than two strings ' + |
| 216 'should throw'); | 216 'should throw'); |
| 217 assert_throws({name: 'TypeError'}, | 217 assert_throws({name: 'TypeError'}, |
| 218 function() { var headers = new Headers([['a', 'b'], | 218 function() { var headers = new Headers([['a', 'b'], |
| 219 ['x', 'y', 'z']]); }, | 219 ['x', 'y', 'z']]); }, |
| 220 'new Headers with a sequence with more than two strings ' + | 220 'new Headers with a sequence with more than two strings ' + |
| 221 'should throw'); | 221 'should throw'); |
| 222 }, 'Headers'); | 222 }, 'Headers'); |
| 223 | 223 |
| 224 test(function(t) { |
| 225 const headers = new Headers; |
| 226 headers.set('b', '1'); |
| 227 headers.set('c', '2'); |
| 228 headers.set('a', '3'); |
| 229 |
| 230 const keys = []; |
| 231 for (let [key, value] of headers) |
| 232 keys.push(key); |
| 233 assert_array_equals(keys, ['a', 'b', 'c'], |
| 234 'The pairs to iterate over should be sorted.'); |
| 235 }, 'Iteration order'); |
| 236 |
| 237 test(function(t) { |
| 238 const headers = new Headers; |
| 239 headers.set('a', '1'); |
| 240 headers.set('b', '2'); |
| 241 headers.set('c', '3'); |
| 242 |
| 243 const iterator = headers.entries(); |
| 244 |
| 245 headers.delete('a'); |
| 246 headers.set('d', '4'); |
| 247 |
| 248 const keys = []; |
| 249 for (let [key, value] of iterator) |
| 250 keys.push(key); |
| 251 assert_array_equals(keys, ['a', 'b', 'c'], |
| 252 'The pairs to iterate over should be the return ' + |
| 253 'value of an algorithm that implicitly makes a copy.'); |
| 254 }, 'Iteration mutation'); |
| 255 |
| 224 done(); | 256 done(); |
| OLD | NEW |