| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:io'; | 5 import 'dart:io'; |
| 6 import 'dart:utf'; | 6 import 'dart:utf'; |
| 7 | 7 |
| 8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
| 9 | 9 |
| 10 void testHttpClientResponseBody() { | 10 void testHttpClientResponseBody() { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 Content-Type: application/json\r | 240 Content-Type: application/json\r |
| 241 \r | 241 \r |
| 242 File content\r | 242 File content\r |
| 243 --AaB03x--\r\n'''.codeUnits, | 243 --AaB03x--\r\n'''.codeUnits, |
| 244 { "files": { 'filename': 'myfile', | 244 { "files": { 'filename': 'myfile', |
| 245 'contentType': 'application/json', | 245 'contentType': 'application/json', |
| 246 'content': 'File content'} }, | 246 'content': 'File content'} }, |
| 247 "form"); | 247 "form"); |
| 248 | 248 |
| 249 test('application/x-www-form-urlencoded', | 249 test('application/x-www-form-urlencoded', |
| 250 '%E5%B9%B3%3D%E4%BB%AE%E5%90%8D=%26%2324179%3B%26%2320206%3B%26%' | 250 '%E5%B9%B3%3D%E4%BB%AE%E5%90%8D=%E5%B9%B3%E4%BB%AE%E5%90%8D&b' |
| 251 '2321517%3B&b=%26%2324179%3B%26%2320206%3B%26%2321517%3B'.codeUnits, | 251 '=%E5%B9%B3%E4%BB%AE%E5%90%8D'.codeUnits, |
| 252 { 'b' : '平仮名', | 252 { 'b' : '平仮名', |
| 253 '平=仮名' : '平仮名'}, | 253 '平=仮名' : '平仮名'}, |
| 254 "form"); | 254 "form"); |
| 255 | 255 |
| 256 test('application/x-www-form-urlencoded', | 256 test('application/x-www-form-urlencoded', |
| 257 'a=%F8+%26%23548%3B'.codeUnits, | 257 'a=%F8+%26%23548%3B'.codeUnits, |
| 258 { 'a' : '\u{FFFD}\u{0224}' }, | 258 { 'a' : '\u{FFFD}Ȥ' }, |
| 259 "form"); | 259 "form"); |
| 260 | 260 |
| 261 test('application/x-www-form-urlencoded', | 261 test('application/x-www-form-urlencoded', |
| 262 'a=%F8+%26%23548%3B'.codeUnits, | |
| 263 { 'a' : 'ø Ȥ' }, | |
| 264 "form", | |
| 265 defaultEncoding: Encoding.ISO_8859_1); | |
| 266 | |
| 267 test('application/x-www-form-urlencoded', | |
| 268 'a=%C3%B8+%C8%A4'.codeUnits, | 262 'a=%C3%B8+%C8%A4'.codeUnits, |
| 269 { 'a' : 'ø Ȥ' }, | 263 { 'a' : 'ø Ȥ' }, |
| 270 "form"); | 264 "form"); |
| 265 |
| 266 test('application/x-www-form-urlencoded', |
| 267 'a=%F8+%26%23548%3B'.codeUnits, |
| 268 { 'a' : 'ø Ȥ' }, |
| 269 "form", |
| 270 defaultEncoding: Encoding.ISO_8859_1); |
| 271 |
| 272 test('application/x-www-form-urlencoded', |
| 273 'name=%26'.codeUnits, |
| 274 { 'name' : '&' }, |
| 275 "form", |
| 276 defaultEncoding: Encoding.ISO_8859_1); |
| 277 |
| 278 test('application/x-www-form-urlencoded', |
| 279 'name=%F8%26'.codeUnits, |
| 280 { 'name' : 'ø&' }, |
| 281 "form", |
| 282 defaultEncoding: Encoding.ISO_8859_1); |
| 283 |
| 284 test('application/x-www-form-urlencoded', |
| 285 'name=%26%3B'.codeUnits, |
| 286 { 'name' : '&;' }, |
| 287 "form", |
| 288 defaultEncoding: Encoding.ISO_8859_1); |
| 289 |
| 290 test('application/x-www-form-urlencoded', |
| 291 'name=%26%23548%3B%26%23548%3B'.codeUnits, |
| 292 { 'name' : 'ȤȤ' }, |
| 293 "form", |
| 294 defaultEncoding: Encoding.ISO_8859_1); |
| 295 |
| 296 test('application/x-www-form-urlencoded', |
| 297 'name=%26'.codeUnits, |
| 298 { 'name' : '&' }, |
| 299 "form"); |
| 300 |
| 301 test('application/x-www-form-urlencoded', |
| 302 'name=%C3%B8%26'.codeUnits, |
| 303 { 'name' : 'ø&' }, |
| 304 "form"); |
| 305 |
| 306 test('application/x-www-form-urlencoded', |
| 307 'name=%26%3B'.codeUnits, |
| 308 { 'name' : '&;' }, |
| 309 "form"); |
| 310 |
| 311 test('application/x-www-form-urlencoded', |
| 312 'name=%C8%A4%26%23548%3B'.codeUnits, |
| 313 { 'name' : 'ȤȤ' }, |
| 314 "form"); |
| 315 |
| 316 test('application/x-www-form-urlencoded', |
| 317 'name=%C8%A4%C8%A4'.codeUnits, |
| 318 { 'name' : 'ȤȤ' }, |
| 319 "form"); |
| 271 } | 320 } |
| 272 | 321 |
| 273 void main() { | 322 void main() { |
| 274 testHttpClientResponseBody(); | 323 testHttpClientResponseBody(); |
| 275 testHttpServerRequestBody(); | 324 testHttpServerRequestBody(); |
| 276 } | 325 } |
| OLD | NEW |