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

Side by Side Diff: tests/standalone/io/http_detach_socket_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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 // 4 //
5 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 response.contentLength = 0; 55 response.contentLength = 0;
56 response.close(); 56 response.close();
57 Expect.throws(response.detachSocket); 57 Expect.throws(response.detachSocket);
58 server.close(); 58 server.close();
59 }); 59 });
60 60
61 Socket.connect("127.0.0.1", server.port).then((socket) { 61 Socket.connect("127.0.0.1", server.port).then((socket) {
62 socket.write("GET / HTTP/1.1\r\n" 62 socket.write("GET / HTTP/1.1\r\n"
63 "content-length: 0\r\n\r\n"); 63 "content-length: 0\r\n\r\n");
64 socket.listen((_) {}, onDone: () { 64 socket.listen((_) {}, onDone: () {
65 socket.close(); 65 socket.close();
66 }); 66 });
67 }); 67 });
68 }); 68 });
69 } 69 }
70 70
71 void testClientDetachSocket() { 71 void testClientDetachSocket() {
72 ServerSocket.bind("127.0.0.1", 0).then((server) { 72 ServerSocket.bind("127.0.0.1", 0).then((server) {
73 server.listen((socket) { 73 server.listen((socket) {
74 socket.write("HTTP/1.1 200 OK\r\n" 74 socket.write("HTTP/1.1 200 OK\r\n"
75 "\r\n" 75 "\r\n"
76 "Test!"); 76 "Test!");
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 }); 111 });
112 }); 112 });
113 }); 113 });
114 } 114 }
115 115
116 void main() { 116 void main() {
117 testServerDetachSocket(); 117 testServerDetachSocket();
118 testBadServerDetachSocket(); 118 testBadServerDetachSocket();
119 testClientDetachSocket(); 119 testClientDetachSocket();
120 } 120 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_client_request_test.dart ('k') | tests/standalone/io/http_server_early_server_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698