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

Unified Diff: tests/standalone/io/http_server_early_server_close_test.dart

Issue 36643002: Don't close existing connection on HttpServer close (and stream cancel). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix 'disable keep-alive' on server close. Created 7 years, 2 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/io/http_detach_socket_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_server_early_server_close_test.dart
diff --git a/tests/standalone/io/http_server_early_server_close_test.dart b/tests/standalone/io/http_server_early_server_close_test.dart
deleted file mode 100644
index 2a1c3db2df071ab916588f9db939cc547d8e5c18..0000000000000000000000000000000000000000
--- a/tests/standalone/io/http_server_early_server_close_test.dart
+++ /dev/null
@@ -1,48 +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 "package:expect/expect.dart";
-import "dart:async";
-import "dart:io";
-import "dart:isolate";
-
-class Server {
- static Future<int> start() {
- return HttpServer.bind("127.0.0.1", 0).then((server) {
- server.listen((HttpRequest request) {
- Timer.run(server.close);
- }, onError: (e) {
- String msg = "No server errors expected: $e";
- var trace = getAttachedStackTrace(e);
- if (trace != null) msg += "\nStackTrace: $trace";
- Expect.fail(msg);
- });
- return server.port;
- });
- }
-}
-
-class Client {
- Client(int port) {
- ReceivePort r = new ReceivePort();
- HttpClient client = new HttpClient();
- client.get("127.0.0.1", port, "/")
- .then((HttpClientRequest request) {
- return request.close();
- })
- .then((HttpClientResponse response) {
- Expect.fail(
- "Response should not be given, as not data was returned.");
- })
- .catchError((e) {
- r.close();
- });
- }
-}
-
-main() {
- Server.start().then((port) {
- new Client(port);
- });
-}
« no previous file with comments | « tests/standalone/io/http_detach_socket_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698