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

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

Issue 12620015: Add more error handling to test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "dart:async"; 5 import "dart:async";
6 import "dart:io"; 6 import "dart:io";
7 import "dart:isolate"; 7 import "dart:isolate";
8 8
9 void sendData(List<int> data, int port) { 9 void sendData(List<int> data, int port) {
10 Socket.connect("127.0.0.1", port).then((socket) { 10 Socket.connect("127.0.0.1", port).then((socket) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 server.close(); 145 server.close();
146 }); 146 });
147 }); 147 });
148 Socket.connect("localhost", server.port) 148 Socket.connect("localhost", server.port)
149 .then((socket) { 149 .then((socket) {
150 socket.write("GET / HTTP/1.1\r\n"); 150 socket.write("GET / HTTP/1.1\r\n");
151 socket.write("Content-Length: 10\r\n"); 151 socket.write("Content-Length: 10\r\n");
152 socket.write("\r\n"); 152 socket.write("\r\n");
153 socket.write("data"); 153 socket.write("data");
154 socket.close(); 154 socket.close();
155 socket.listen((_) {}); 155 socket.listen((_) {}, onError: (_) {});
156 socket.done.catchError((_) {});
156 }); 157 });
157 }); 158 });
158 } 159 }
159 160
160 void main() { 161 void main() {
161 testEarlyClose1(); 162 testEarlyClose1();
162 testEarlyClose2(); 163 testEarlyClose2();
163 testEarlyClose3(); 164 testEarlyClose3();
164 } 165 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698