Chromium Code Reviews| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 keys.push(key); | 232 keys.push(key); |
| 233 assert_array_equals(keys, ['a', 'b', 'c'], | 233 assert_array_equals(keys, ['a', 'b', 'c'], |
| 234 'The pairs to iterate over should be sorted.'); | 234 'The pairs to iterate over should be sorted.'); |
| 235 }, 'Iteration order'); | 235 }, 'Iteration order'); |
| 236 | 236 |
| 237 test(function(t) { | 237 test(function(t) { |
| 238 const headers = new Headers; | 238 const headers = new Headers; |
| 239 headers.set('a', '1'); | 239 headers.set('a', '1'); |
| 240 headers.set('b', '2'); | 240 headers.set('b', '2'); |
| 241 headers.set('c', '3'); | 241 headers.set('c', '3'); |
| 242 headers.append('a', '2'); | |
| 243 headers.append('a', '3'); | |
| 242 | 244 |
| 243 const iterator = headers.entries(); | 245 const iterator = headers.entries(); |
| 244 | 246 |
| 245 headers.delete('a'); | 247 headers.delete('a'); |
| 246 headers.set('d', '4'); | 248 headers.set('d', '4'); |
| 247 | 249 |
| 248 const keys = []; | 250 const keys = []; |
| 249 for (let [key, value] of iterator) | 251 const values = []; |
| 252 for (let [key, value] of iterator){ | |
|
jsbell
2016/12/12 22:38:31
nit: space between ) and {
| |
| 250 keys.push(key); | 253 keys.push(key); |
| 254 values.push(value); | |
| 255 } | |
|
jsbell
2016/12/12 22:38:31
nit: } should line up with for
| |
| 251 assert_array_equals(keys, ['a', 'b', 'c'], | 256 assert_array_equals(keys, ['a', 'b', 'c'], |
| 252 'The pairs to iterate over should be the return ' + | 257 'The pairs to iterate over should be the return ' + |
| 253 'value of an algorithm that implicitly makes a copy.'); | 258 'value of an algorithm that implicitly makes a copy.'); |
| 259 assert_array_equals(values, ['1,2,3', '2', '3'], | |
| 260 "The values should be combined and separated by ','."); | |
| 254 }, 'Iteration mutation'); | 261 }, 'Iteration mutation'); |
| 255 | 262 |
| 256 done(); | 263 done(); |
| OLD | NEW |