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

Unified Diff: tests/standalone/io/socket_test.dart

Issue 2946333002: Added timeout parameter to RawSocket and Socket connect, which allows for the specification of a ma… (Closed)
Patch Set: Updated CHANGELOG.md Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4ed8355e39bc2da5d1ad1d6a335a0557d21fd55a 100644
--- a/tests/standalone/io/socket_test.dart
+++ b/tests/standalone/io/socket_test.dart
@@ -197,6 +197,18 @@ void testConnectStreamDataCloseCancel(bool useDestroy) {
});
}
+void testConnectTimeout() {
+ asyncStart();
+ Duration timeout = new Duration(milliseconds: 20);
+ Socket.connect("8.8.8.7", 80, timeout: timeout).then((socket) {
+ Expect.fail("Unexpected connection made.");
+ asyncEnd();
+ }).catchError((e) {
+ Expect.isTrue(e is SocketException);
+ asyncEnd();
+ });
+}
+
main() {
testArguments();
testSimpleBind();
@@ -209,4 +221,5 @@ main() {
testConnectStreamDataClose(false);
testConnectStreamDataCloseCancel(true);
testConnectStreamDataCloseCancel(false);
+ testConnectTimeout();
}
« no previous file with comments | « sdk/lib/io/socket.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698