| 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 "package:expect/expect.dart"; | |
| 6 import "dart:io"; | 5 import "dart:io"; |
| 7 | 6 |
| 8 void testHttpConnectionInfo() { | 7 void testHttpConnectionInfo() { |
| 9 HttpServer.bind("0.0.0.0", 0).then((server) { | 8 HttpServer.bind("0.0.0.0", 0).then((server) { |
| 10 int clientPort; | 9 int clientPort; |
| 11 | 10 |
| 12 server.listen((request) { | 11 server.listen((request) { |
| 13 var response = request.response; | 12 var response = request.response; |
| 14 Expect.isTrue(request.connectionInfo.remoteHost is String); | 13 Expect.isTrue(request.connectionInfo.remoteHost is String); |
| 15 Expect.isTrue(response.connectionInfo.remoteHost is String); | 14 Expect.isTrue(response.connectionInfo.remoteHost is String); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 40 client.close(); | 39 client.close(); |
| 41 server.close(); | 40 server.close(); |
| 42 }); | 41 }); |
| 43 }); | 42 }); |
| 44 }); | 43 }); |
| 45 } | 44 } |
| 46 | 45 |
| 47 void main() { | 46 void main() { |
| 48 testHttpConnectionInfo(); | 47 testHttpConnectionInfo(); |
| 49 } | 48 } |
| OLD | NEW |