Index: tests/standalone/src/io/HttpServerTest.dart |
diff --git a/tests/standalone/src/io/HttpServerTest.dart b/tests/standalone/src/io/HttpServerTest.dart |
deleted file mode 100644 |
index 7cda6f4599646a86cb9fc6d481ca6a749c5ba8de..0000000000000000000000000000000000000000 |
--- a/tests/standalone/src/io/HttpServerTest.dart |
+++ /dev/null |
@@ -1,65 +0,0 @@ |
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
-// for details. All rights reserved. Use of this source code is governed by a |
-// BSD-style license that can be found in the LICENSE file. |
- |
-#import("dart:io"); |
-#import("dart:isolate"); |
- |
-void testListenOn() { |
- ServerSocket socket = new ServerSocket("127.0.0.1", 0, 5); |
- |
- socket.onError = (Exception e) { |
- Expect.fail("ServerSocket closed unexpected"); |
- }; |
- |
- void test(void onDone()) { |
- HttpServer server = new HttpServer(); |
- Expect.throws(() => server.port); |
- |
- ReceivePort serverPort = new ReceivePort(); |
- server.defaultRequestHandler = |
- (HttpRequest request, HttpResponse response) { |
- request.inputStream.onClosed = () { |
- response.outputStream.close(); |
- serverPort.close(); |
- }; |
- }; |
- |
- server.onError = (Exception e) { |
- Expect.fail("Unexpected error in Http Server: $e"); |
- }; |
- |
- server.listenOn(socket); |
- Expect.equals(socket.port, server.port); |
- |
- HttpClient client = new HttpClient(); |
- HttpClientConnection conn = client.get("127.0.0.1", socket.port, "/"); |
- conn.onRequest = (HttpClientRequest request) { |
- request.outputStream.close(); |
- }; |
- ReceivePort clientPort = new ReceivePort(); |
- conn.onResponse = (HttpClientResponse response) { |
- response.inputStream.onClosed = () { |
- client.shutdown(); |
- clientPort.close(); |
- server.close(); |
- Expect.throws(() => server.port); |
- onDone(); |
- }; |
- }; |
- conn.onError = (Exception e) { |
- Expect.fail("Unexpected error in Http Client: $e"); |
- }; |
- }; |
- |
- // Test two connection after each other. |
- test(() { |
- test(() { |
- socket.close(); |
- }); |
- }); |
-} |
- |
-void main() { |
- testListenOn(); |
-} |