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

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

Issue 984403004: Fixed a number of bugs on RawSocket and Socket (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
Index: tests/standalone/io/socket_exception_test.dart
diff --git a/tests/standalone/io/socket_exception_test.dart b/tests/standalone/io/socket_exception_test.dart
index 40a58511fee55907f132f5764fd27fabd1dcaba7..d5d4e0e12c509e8568d9037acc9b900ecde4fff6 100644
--- a/tests/standalone/io/socket_exception_test.dart
+++ b/tests/standalone/io/socket_exception_test.dart
@@ -71,8 +71,9 @@ class SocketExceptionTest {
Expect.isNotNull(server);
int port = server.port;
Socket.connect("127.0.0.1", port).then((client) {
- Expect.isNotNull(client);
+ Expect.isNotNull(client);
client.close();
+ // First calls for which exceptions are note expected.
try {
client.close();
} on SocketException catch(ex) {
@@ -87,7 +88,6 @@ class SocketExceptionTest {
} on SocketException catch(ex) {
exceptionCaught = true;
} catch (ex) {
- print(ex);
wrongExceptionCaught = true;
}
Expect.isFalse(exceptionCaught);
@@ -103,6 +103,48 @@ class SocketExceptionTest {
Expect.isFalse(exceptionCaught);
Expect.isFalse(wrongExceptionCaught);
+ // From here exceptions are expected.
+ exceptionCaught = false;
+ try {
+ client.port;
+ } on SocketException catch(ex) {
+ exceptionCaught = true;
+ } catch (ex) {
+ wrongExceptionCaught = true;
+ }
+ Expect.isTrue(exceptionCaught);
+ Expect.isFalse(wrongExceptionCaught);
+ exceptionCaught = false;
+ try {
+ client.remotePort;
+ } on SocketException catch(ex) {
+ exceptionCaught = true;
+ } catch (ex) {
+ wrongExceptionCaught = true;
+ }
+ Expect.isTrue(exceptionCaught);
+ Expect.isFalse(wrongExceptionCaught);
+ exceptionCaught = false;
+ try {
+ client.address;
+ } on SocketException catch(ex) {
+ exceptionCaught = true;
+ } catch (ex) {
+ wrongExceptionCaught = true;
+ }
+ Expect.isTrue(exceptionCaught);
+ Expect.isFalse(wrongExceptionCaught);
+ exceptionCaught = false;
+ try {
+ client.remoteAddress;
+ } on SocketException catch(ex) {
+ exceptionCaught = true;
+ } catch (ex) {
+ wrongExceptionCaught = true;
+ }
+ Expect.isTrue(exceptionCaught);
+ Expect.isFalse(wrongExceptionCaught);
+
server.close();
});
});
« tests/standalone/io/raw_socket_test.dart ('K') | « tests/standalone/io/raw_socket_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698