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 // VMOptions= | 5 // VMOptions= |
6 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
7 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
8 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
9 | 9 |
10 import 'dart:async'; | 10 import 'dart:async'; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 if (responses == 2) { | 340 if (responses == 2) { |
341 httpClient.close(); | 341 httpClient.close(); |
342 server.shutdown(); | 342 server.shutdown(); |
343 completer.complete(true); | 343 completer.complete(true); |
344 } | 344 } |
345 }); | 345 }); |
346 } | 346 } |
347 | 347 |
348 httpClient.get("127.0.0.1", port, "/contenttype1") | 348 httpClient.get("127.0.0.1", port, "/contenttype1") |
349 .then((request) { | 349 .then((request) { |
350 ContentType contentType = new ContentType(); | 350 request.headers.contentType = |
351 contentType.value = "text/html"; | 351 new ContentType("text", "html", "utf-8"); |
352 contentType.parameters["charset"] = "utf-8"; | |
353 request.headers.contentType = contentType; | |
354 return request.close(); | 352 return request.close(); |
355 }) | 353 }) |
356 .then(processResponse); | 354 .then(processResponse); |
357 | 355 |
358 httpClient.get("127.0.0.1", port, "/contenttype2") | 356 httpClient.get("127.0.0.1", port, "/contenttype2") |
359 .then((request) { | 357 .then((request) { |
360 request.headers.set(HttpHeaders.CONTENT_TYPE, | 358 request.headers.set(HttpHeaders.CONTENT_TYPE, |
361 "text/html; charset = utf-8"); | 359 "text/html; charset = utf-8"); |
362 return request.close(); | 360 return request.close(); |
363 }) | 361 }) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 421 |
424 void main() { | 422 void main() { |
425 testHost().then((_) { | 423 testHost().then((_) { |
426 return testExpires().then((_) { | 424 return testExpires().then((_) { |
427 return testContentType().then((_) { | 425 return testContentType().then((_) { |
428 return testCookies(); | 426 return testCookies(); |
429 }); | 427 }); |
430 }); | 428 }); |
431 }); | 429 }); |
432 } | 430 } |
OLD | NEW |