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 // Tests socket exceptions. | 5 // Tests socket exceptions. |
6 | 6 |
7 #import("dart:isolate"); | 7 #import("dart:isolate"); |
8 #import("dart:io"); | 8 #import("dart:io"); |
9 | 9 |
10 class SocketExceptionTest { | 10 class SocketExceptionTest { |
11 | 11 |
12 static final PORT = 0; | 12 static const PORT = 0; |
13 static final HOST = "127.0.0.1"; | 13 static const HOST = "127.0.0.1"; |
14 | 14 |
15 static void serverSocketExceptionTest() { | 15 static void serverSocketExceptionTest() { |
16 bool exceptionCaught = false; | 16 bool exceptionCaught = false; |
17 bool wrongExceptionCaught = false; | 17 bool wrongExceptionCaught = false; |
18 | 18 |
19 ServerSocket server = new ServerSocket(HOST, PORT, 10); | 19 ServerSocket server = new ServerSocket(HOST, PORT, 10); |
20 Expect.equals(true, server !== null); | 20 Expect.equals(true, server !== null); |
21 server.close(); | 21 server.close(); |
22 try { | 22 try { |
23 server.close(); | 23 server.close(); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 indexOutOfRangeExceptionTest(); | 199 indexOutOfRangeExceptionTest(); |
200 unknownHostTest(); | 200 unknownHostTest(); |
201 // TODO(sgjesse): This test seems to fail on the buildbot. | 201 // TODO(sgjesse): This test seems to fail on the buildbot. |
202 //unresponsiveHostTest(); | 202 //unresponsiveHostTest(); |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 main() { | 206 main() { |
207 SocketExceptionTest.testMain(); | 207 SocketExceptionTest.testMain(); |
208 } | 208 } |
OLD | NEW |