Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: tests/standalone/src/io/HttpServerTest.dart

Issue 10252020: test rename overhaul: step 12 - standalone (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/src/io/HttpServerSocketTest.dart ('k') | tests/standalone/src/io/HttpShutdownTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
-}
« no previous file with comments | « tests/standalone/src/io/HttpServerSocketTest.dart ('k') | tests/standalone/src/io/HttpShutdownTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698