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

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

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 4 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 5506d6da9ccc08098b5693dbbe78bcc74da28363..924822dae3e93571c9dd2fd9ac5515a557d15311 100644
--- a/tests/standalone/io/socket_exception_test.dart
+++ b/tests/standalone/io/socket_exception_test.dart
@@ -21,9 +21,9 @@ class SocketExceptionTest {
server.close();
try {
server.close();
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(false, exceptionCaught);
@@ -45,9 +45,9 @@ class SocketExceptionTest {
client.close();
try {
client.close();
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(false, exceptionCaught);
@@ -55,9 +55,9 @@ class SocketExceptionTest {
exceptionCaught = false;
try {
client.available();
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -66,9 +66,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(10);
client.readList(buffer, 0 , 10);
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -77,9 +77,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(10);
client.writeList(buffer, 0, 10);
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -88,9 +88,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(42);
input.readInto(buffer, 0, 12);
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -99,9 +99,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(42);
output.writeFrom(buffer, 0, 12);
- } catch (SocketIOException ex) {
+ } on SocketIOException catch(ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -124,9 +124,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(10);
client.readList(buffer, -1, 1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -136,9 +136,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(10);
client.readList(buffer, 0, -1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -148,9 +148,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(10);
client.writeList(buffer, -1, 1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
@@ -160,9 +160,9 @@ class SocketExceptionTest {
try {
List<int> buffer = new List<int>(10);
client.writeList(buffer, 0, -1);
- } catch (IndexOutOfRangeException ex) {
+ } on IndexOutOfRangeException catch (ex) {
exceptionCaught = true;
- } catch (Exception ex) {
+ } on Exception catch (ex) {
wrongExceptionCaught = true;
}
Expect.equals(true, exceptionCaught);
« no previous file with comments | « tests/standalone/io/read_into_const_list_test.dart ('k') | tests/standalone/io/socket_invalid_arguments_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698