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

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

Issue 250453004: Version 1.3.4 (Closed) Base URL: http://dart.googlecode.com/svn/branches/1.3/
Patch Set: Created 6 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 | « dart/runtime/bin/socket_patch.dart ('k') | dart/tools/VERSION » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/standalone/io/http_server_test.dart
===================================================================
--- dart/tests/standalone/io/http_server_test.dart (revision 35362)
+++ dart/tests/standalone/io/http_server_test.dart (working copy)
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import "dart:async";
+import "dart:typed_data";
import "dart:io";
import "package:async_helper/async_helper.dart";
@@ -110,8 +111,34 @@
}
+void testHttpServerClientClose() {
+ HttpServer.bind("127.0.0.1", 0).then((server) {
+ runZoned(() {
+ server.listen((request) {
+ request.response.bufferOutput = false;
+ request.response.add(new Uint8List(64 * 1024));
+ new Timer(const Duration(milliseconds: 100), () {
+ request.response.close().then((_) {
+ server.close();
+ });
+ });
+ });
+ }, onError: (e, s) {
+ Expect.fail("Unexpected error: $e(${e.hashCode})\n$s");
+ });
+ var client = new HttpClient();
+ client.get("127.0.0.1", server.port, "/")
+ .then((request) => request.close())
+ .then((response) {
+ response.listen((_) {}).cancel();
+ });
+ });
+}
+
+
void main() {
testListenOn();
testHttpServerZone();
testHttpServerZoneError();
+ testHttpServerClientClose();
}
« no previous file with comments | « dart/runtime/bin/socket_patch.dart ('k') | dart/tools/VERSION » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698