| Index: tests/standalone/io/http_advanced_test.dart
|
| diff --git a/tests/standalone/io/http_advanced_test.dart b/tests/standalone/io/http_advanced_test.dart
|
| index 77e36fa916283f9c8403df12e82cd0654c346821..a37d025c57fd426d05154fd2ef08319074d09d5c 100644
|
| --- a/tests/standalone/io/http_advanced_test.dart
|
| +++ b/tests/standalone/io/http_advanced_test.dart
|
| @@ -178,6 +178,11 @@ class TestServer {
|
| response.outputStream.close();
|
| }
|
|
|
| + void _flushHandler(HttpRequest request, HttpResponse response) {
|
| + response.outputStream.flush();
|
| + response.outputStream.close();
|
| + }
|
| +
|
| void init() {
|
| // Setup request handlers.
|
| _requestHandlers = new Map();
|
| @@ -209,6 +214,10 @@ class TestServer {
|
| (HttpRequest request, HttpResponse response) {
|
| _cookie2Handler(request, response);
|
| };
|
| + _requestHandlers["/flush"] =
|
| + (HttpRequest request, HttpResponse response) {
|
| + _flushHandler(request, response);
|
| + };
|
| }
|
|
|
| void dispatch(message, replyTo) {
|
| @@ -405,9 +414,29 @@ void testCookies() {
|
| testServerMain.start();
|
| }
|
|
|
| +void testFlush() {
|
| + TestServerMain testServerMain = new TestServerMain();
|
| + testServerMain.setServerStartedHandler((int port) {
|
| + HttpClient httpClient = new HttpClient();
|
| +
|
| + HttpClientConnection conn = httpClient.get("127.0.0.1", port, "/flush");
|
| + conn.onRequest = (HttpClientRequest request) {
|
| + request.outputStream.flush();
|
| + request.outputStream.close();
|
| + };
|
| + conn.onResponse = (HttpClientResponse response) {
|
| + Expect.equals(HttpStatus.OK, response.statusCode);
|
| + httpClient.shutdown();
|
| + testServerMain.shutdown();
|
| + };
|
| + });
|
| + testServerMain.start();
|
| +}
|
| +
|
| void main() {
|
| testHost();
|
| testExpires();
|
| testContentType();
|
| testCookies();
|
| + testFlush();
|
| }
|
|
|