OLD | NEW |
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 | 7 |
8 import "package:async_helper/async_helper.dart"; | 8 import "package:async_helper/async_helper.dart"; |
9 import "package:expect/expect.dart"; | 9 import "package:expect/expect.dart"; |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 request.listen((_) {}, onError: (error) { | 94 request.listen((_) {}, onError: (error) { |
95 Expect.notEquals(Zone.ROOT, Zone.current); | 95 Expect.notEquals(Zone.ROOT, Zone.current); |
96 server.close(); | 96 server.close(); |
97 throw error; | 97 throw error; |
98 }); | 98 }); |
99 }); | 99 }); |
100 Socket.connect("127.0.0.1", server.port).then((socket) { | 100 Socket.connect("127.0.0.1", server.port).then((socket) { |
101 socket.write('GET / HTTP/1.1\r\nContent-Length: 100\r\n\r\n'); | 101 socket.write('GET / HTTP/1.1\r\nContent-Length: 100\r\n\r\n'); |
102 socket.write('some body'); | 102 socket.write('some body'); |
103 socket.close(); | 103 socket.close(); |
| 104 socket.listen(null); |
104 }); | 105 }); |
105 }); | 106 }); |
106 }, onError: (e) { | 107 }, onError: (e) { |
107 asyncEnd(); | 108 asyncEnd(); |
108 }); | 109 }); |
109 } | 110 } |
110 | 111 |
111 | 112 |
112 void main() { | 113 void main() { |
113 testListenOn(); | 114 testListenOn(); |
114 testHttpServerZone(); | 115 testHttpServerZone(); |
115 testHttpServerZoneError(); | 116 testHttpServerZoneError(); |
116 } | 117 } |
OLD | NEW |