Chromium Code Reviews| Index: tests/standalone/io/socket_test.dart |
| diff --git a/tests/standalone/io/socket_test.dart b/tests/standalone/io/socket_test.dart |
| index 314e1113924477381ea1b2f1821523e2a052ba85..40d1fd6bc7a8bc09bd1802b60228e0260fd373a9 100644 |
| --- a/tests/standalone/io/socket_test.dart |
| +++ b/tests/standalone/io/socket_test.dart |
| @@ -197,6 +197,17 @@ void testConnectStreamDataCloseCancel(bool useDestroy) { |
| }); |
| } |
| +void testConnectTimeout() { |
| + Duration timeout = new Duration(milliseconds: 20); |
| + Socket.connect("8.8.8.7", 80, timeout: timeout).then((socket) { |
|
zra
2017/06/21 20:32:32
asyncStart();
bkonyi
2017/06/21 21:20:05
Done.
|
| + Expect.fail("Unexpected connection made."); |
| + }).catchError((e) { |
| + if (!(e is SocketException)) { |
|
zra
2017/06/21 20:32:32
Expect.isTrue(e is SocketException)
bkonyi
2017/06/21 21:20:05
Done.
|
| + Expect.fail("Caught unexpected exception: ${e}"); |
| + } |
|
zra
2017/06/21 20:32:32
asyncEnd();
bkonyi
2017/06/21 21:20:04
Done.
|
| + }); |
| +} |
| + |
| main() { |
| testArguments(); |
| testSimpleBind(); |
| @@ -209,4 +220,5 @@ main() { |
| testConnectStreamDataClose(false); |
| testConnectStreamDataCloseCancel(true); |
| testConnectStreamDataCloseCancel(false); |
| + testConnectTimeout(); |
| } |