OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void set onClosed(void callback()) { | 102 void set onClosed(void callback()) { |
103 _onClosed = callback; | 103 _onClosed = callback; |
104 } | 104 } |
105 | 105 |
106 void set onError(void callback(e)) { | 106 void set onError(void callback(e)) { |
107 _onError = callback; | 107 _onError = callback; |
108 } | 108 } |
109 | 109 |
110 OutputStream get outputStream => _outputStream; | 110 OutputStream get outputStream => _outputStream; |
111 | 111 |
112 int hashCode() => _hashCode; | 112 int get hashCode => _hashCode; |
113 | 113 |
114 List<int> _read; | 114 List<int> _read; |
115 bool _closed = false; | 115 bool _closed = false; |
116 int _hashCode; | 116 int _hashCode; |
117 Function _onData; | 117 Function _onData; |
118 Function _onClosed; | 118 Function _onClosed; |
119 Function _onError; | 119 Function _onError; |
120 Function _onClosedInternal; | 120 Function _onClosedInternal; |
121 List<int> _data; | 121 List<int> _data; |
122 ExpectedDataOutputStream _outputStream; | 122 ExpectedDataOutputStream _outputStream; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 "GET / HTTP/1.1\r\nKeep-Alive: False\r\n\r\n", | 212 "GET / HTTP/1.1\r\nKeep-Alive: False\r\n\r\n", |
213 "HTTP/1.1 200 OK\r\ntransfer-encoding: chunked\r\nconnection: close" | 213 "HTTP/1.1 200 OK\r\ntransfer-encoding: chunked\r\nconnection: close" |
214 "\r\n\r\n0\r\n\r\n"); | 214 "\r\n\r\n0\r\n\r\n"); |
215 | 215 |
216 server.close(); | 216 server.close(); |
217 } | 217 } |
218 | 218 |
219 void main() { | 219 void main() { |
220 testSocketClose(); | 220 testSocketClose(); |
221 } | 221 } |
OLD | NEW |