Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: tests/standalone/io/http_server_test.dart

Issue 25010004: Add .address to [Raw]ServerSocket and HttpServer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove 'host' arg from BarbackServer constructor. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | tests/standalone/io/socket_ipv6_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 if (trace != null) msg += "\nStackTrace: $trace"; 34 if (trace != null) msg += "\nStackTrace: $trace";
35 Expect.fail(msg); 35 Expect.fail(msg);
36 }); 36 });
37 } 37 }
38 38
39 // Test two connection after each other. 39 // Test two connection after each other.
40 asyncStart(); 40 asyncStart();
41 ServerSocket.bind("127.0.0.1", 0).then((s) { 41 ServerSocket.bind("127.0.0.1", 0).then((s) {
42 socket = s; 42 socket = s;
43 server = new HttpServer.listenOn(socket); 43 server = new HttpServer.listenOn(socket);
44 Expect.equals(server.address.address, '127.0.0.1');
45 Expect.equals(server.address.host, '127.0.0.1');
44 server.listen((HttpRequest request) { 46 server.listen((HttpRequest request) {
45 request.listen( 47 request.listen(
46 (_) {}, 48 (_) {},
47 onDone: () => request.response.close()); 49 onDone: () => request.response.close());
48 }); 50 });
49 51
50 test(() { 52 test(() {
51 test(() { 53 test(() {
52 server.close(); 54 server.close();
53 Expect.throws(() => server.port); 55 Expect.throws(() => server.port);
56 Expect.throws(() => server.address);
54 socket.close(); 57 socket.close();
55 asyncEnd(); 58 asyncEnd();
56 }); 59 });
57 }); 60 });
58 }); 61 });
59 } 62 }
60 63
61 void main() { 64 void main() {
62 testListenOn(); 65 testListenOn();
63 } 66 }
OLDNEW
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | tests/standalone/io/socket_ipv6_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698