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

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

Issue 11879042: Improve the error-propagation on socket streams (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 7 years, 11 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 | « tests/standalone/io/http_server_early_client_close_test.dart ('k') | 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) 2012, 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:io"; 5 import "dart:io";
6 import "dart:isolate"; 6 import "dart:isolate";
7 import "dart:math"; 7 import "dart:math";
8 8
9 class ExpectedDataOutputStream implements OutputStream { 9 class ExpectedDataOutputStream implements OutputStream {
10 ExpectedDataOutputStream(List<int> this._data, 10 ExpectedDataOutputStream(List<int> this._data,
11 int this._cutoff, 11 int this._cutoff,
12 bool this._closeAsError, 12 bool this._closeAsError,
13 SocketMock this._socket); 13 SocketMock this._socket);
14 14
15 void set onNoPendingWrites(void callback()) { 15 void set onNoPendingWrites(void callback()) {
16 _onNoPendingWrites = callback; 16 _onNoPendingWrites = callback;
17 } 17 }
18 18
19 void set onClosed(void callback()) {
20 // Not used in test.
21 }
22
19 void set onError(void callback(e)) { 23 void set onError(void callback(e)) {
20 _onError = callback; 24 _onError = callback;
21 } 25 }
22 26
23 bool write(List data, [bool copyBuffer = true]) { 27 bool write(List data, [bool copyBuffer = true]) {
24 _onData(data); 28 _onData(data);
25 return true; 29 return true;
26 } 30 }
27 31
28 bool writeFrom(List data, [int offset = 0, int len]) { 32 bool writeFrom(List data, [int offset = 0, int len]) {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 "GET / HTTP/1.1\r\nKeep-Alive: False\r\n\r\n", 228 "GET / HTTP/1.1\r\nKeep-Alive: False\r\n\r\n",
225 "HTTP/1.1 200 OK\r\ntransfer-encoding: chunked\r\nconnection: close" 229 "HTTP/1.1 200 OK\r\ntransfer-encoding: chunked\r\nconnection: close"
226 "\r\n\r\n0\r\n\r\n"); 230 "\r\n\r\n0\r\n\r\n");
227 231
228 server.close(); 232 server.close();
229 } 233 }
230 234
231 void main() { 235 void main() {
232 testSocketClose(); 236 testSocketClose();
233 } 237 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_server_early_client_close_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698