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

Side by Side Diff: tests/standalone/io/http_server_early_client_close_test.dart

Issue 14640008: Change the signature for all network bind calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by whesse@ Created 7 years, 7 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 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:async"; 6 import "dart:async";
7 import "dart:io"; 7 import "dart:io";
8 import "dart:isolate"; 8 import "dart:isolate";
9 9
10 void sendData(List<int> data, int port) { 10 void sendData(List<int> data, int port) {
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 server.close(); 128 server.close();
129 } 129 }
130 }); 130 });
131 }); 131 });
132 } 132 }
133 makeRequest(); 133 makeRequest();
134 }); 134 });
135 } 135 }
136 136
137 void testEarlyClose3() { 137 void testEarlyClose3() {
138 HttpServer.bind().then((server) { 138 HttpServer.bind("127.0.0.1", 0).then((server) {
139 server.listen((request) { 139 server.listen((request) {
140 var subscription; 140 var subscription;
141 subscription = request.listen( 141 subscription = request.listen(
142 (_) {}, 142 (_) {},
143 onError: (error) { 143 onError: (error) {
144 // subscription.cancel should not trigger an error. 144 // subscription.cancel should not trigger an error.
145 subscription.cancel(); 145 subscription.cancel();
146 server.close(); 146 server.close();
147 }); 147 });
148 }); 148 });
149 Socket.connect("127.0.0.1", server.port) 149 Socket.connect("127.0.0.1", server.port)
150 .then((socket) { 150 .then((socket) {
151 socket.write("GET / HTTP/1.1\r\n"); 151 socket.write("GET / HTTP/1.1\r\n");
152 socket.write("Content-Length: 10\r\n"); 152 socket.write("Content-Length: 10\r\n");
153 socket.write("\r\n"); 153 socket.write("\r\n");
154 socket.write("data"); 154 socket.write("data");
155 socket.close(); 155 socket.close();
156 socket.listen((_) {}, onError: (_) {}); 156 socket.listen((_) {}, onError: (_) {});
157 socket.done.catchError((_) {}); 157 socket.done.catchError((_) {});
158 }); 158 });
159 }); 159 });
160 } 160 }
161 161
162 void main() { 162 void main() {
163 testEarlyClose1(); 163 testEarlyClose1();
164 testEarlyClose2(); 164 testEarlyClose2();
165 testEarlyClose3(); 165 testEarlyClose3();
166 } 166 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_request_pipeling_test.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698