| 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 | 7 |
| 8 class ExpectedDataOutputStream implements OutputStream { | 8 class ExpectedDataOutputStream implements OutputStream { |
| 9 ExpectedDataOutputStream(List<int> this._data, | 9 ExpectedDataOutputStream(List<int> this._data, |
| 10 int this._cutoff, | 10 int this._cutoff, |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 } | 140 } |
| 141 | 141 |
| 142 void close() { | 142 void close() { |
| 143 Expect.fail("Don't close the connection, we attach to this socket"); | 143 Expect.fail("Don't close the connection, we attach to this socket"); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void set onConnection(void callback(Socket connection)) { | 146 void set onConnection(void callback(Socket connection)) { |
| 147 _onConnection = callback; | 147 _onConnection = callback; |
| 148 } | 148 } |
| 149 | 149 |
| 150 void set onError(void callback()) { | 150 void set onError(void callback(Exception)) { |
| 151 _onError = callback; | 151 _onError = callback; |
| 152 } | 152 } |
| 153 | 153 |
| 154 int get port() => _port; | 154 int get port() => _port; |
| 155 | 155 |
| 156 int _port; | 156 int _port; |
| 157 Function _onConnection; | 157 Function _onConnection; |
| 158 Function _onError; | 158 Function _onError; |
| 159 Set<Socket> _sockets; | 159 Set<Socket> _sockets; |
| 160 } | 160 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 "GET / HTTP/1.1\r\nKeep-Alive: False\r\n\r\n", | 205 "GET / HTTP/1.1\r\nKeep-Alive: False\r\n\r\n", |
| 206 "HTTP/1.1 200 OK\r\ntransfer-encoding: chunked\r\nconnection: close" + | 206 "HTTP/1.1 200 OK\r\ntransfer-encoding: chunked\r\nconnection: close" + |
| 207 "\r\n\r\n0\r\n\r\n"); | 207 "\r\n\r\n0\r\n\r\n"); |
| 208 | 208 |
| 209 server.close(); | 209 server.close(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void main() { | 212 void main() { |
| 213 testSocketClose(); | 213 testSocketClose(); |
| 214 } | 214 } |
| OLD | NEW |