| 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:io"; | 6 import "dart:io"; |
| 6 import "dart:typed_data"; | 7 import "dart:typed_data"; |
| 7 | 8 |
| 8 import "package:async_helper/async_helper.dart"; | 9 import "package:async_helper/async_helper.dart"; |
| 9 import "package:expect/expect.dart"; | 10 import "package:expect/expect.dart"; |
| 10 | 11 |
| 11 void testClientRequest(Future handler(request)) { | 12 void testClientRequest(Future handler(request)) { |
| 12 HttpServer.bind("127.0.0.1", 0).then((server) { | 13 HttpServer.bind("127.0.0.1", 0).then((server) { |
| 13 server.listen((request) { | 14 server.listen((request) { |
| 14 request.listen((_) {}, onDone: () { | 15 request.listen((_) {}, onDone: () { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 }, test: (e) => e is HttpException); | 105 }, test: (e) => e is HttpException); |
| 105 return request.done; | 106 return request.done; |
| 106 }); | 107 }); |
| 107 } | 108 } |
| 108 | 109 |
| 109 void main() { | 110 void main() { |
| 110 testResponseDone(); | 111 testResponseDone(); |
| 111 testBadResponseAdd(); | 112 testBadResponseAdd(); |
| 112 testBadResponseClose(); | 113 testBadResponseClose(); |
| 113 } | 114 } |
| OLD | NEW |