| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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:isolate"); | 10 #import("dart:isolate"); |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 testServerMain.start(); | 424 testServerMain.start(); |
| 425 } | 425 } |
| 426 | 426 |
| 427 | 427 |
| 428 void testReasonPhrase() { | 428 void testReasonPhrase() { |
| 429 TestServerMain testServerMain = new TestServerMain(); | 429 TestServerMain testServerMain = new TestServerMain(); |
| 430 testServerMain.setServerStartedHandler((int port) { | 430 testServerMain.setServerStartedHandler((int port) { |
| 431 HttpClient httpClient = new HttpClient(); | 431 HttpClient httpClient = new HttpClient(); |
| 432 HttpClientConnection conn = | 432 HttpClientConnection conn = |
| 433 httpClient.get("127.0.0.1", port, "/reasonformoving"); | 433 httpClient.get("127.0.0.1", port, "/reasonformoving"); |
| 434 conn.followRedirects = false; |
| 434 conn.onResponse = (HttpClientResponse response) { | 435 conn.onResponse = (HttpClientResponse response) { |
| 435 Expect.equals(HttpStatus.MOVED_PERMANENTLY, response.statusCode); | 436 Expect.equals(HttpStatus.MOVED_PERMANENTLY, response.statusCode); |
| 436 Expect.equals("Don't come looking here any more", response.reasonPhrase); | 437 Expect.equals("Don't come looking here any more", response.reasonPhrase); |
| 437 httpClient.shutdown(); | 438 httpClient.shutdown(); |
| 438 testServerMain.shutdown(); | 439 testServerMain.shutdown(); |
| 439 }; | 440 }; |
| 440 }); | 441 }); |
| 441 testServerMain.start(); | 442 testServerMain.start(); |
| 442 } | 443 } |
| 443 | 444 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 testPOST(false); | 522 testPOST(false); |
| 522 testReadInto(true); | 523 testReadInto(true); |
| 523 testReadInto(false); | 524 testReadInto(false); |
| 524 testReadShort(true); | 525 testReadShort(true); |
| 525 testReadShort(false); | 526 testReadShort(false); |
| 526 test404(); | 527 test404(); |
| 527 testReasonPhrase(); | 528 testReasonPhrase(); |
| 528 testHost(); | 529 testHost(); |
| 529 testExpires(); | 530 testExpires(); |
| 530 } | 531 } |
| OLD | NEW |