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

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

Issue 14251006: Remove AsyncError with Expando. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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 | « tests/standalone/io/http_10_test.dart ('k') | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/http_content_length_test.dart
diff --git a/tests/standalone/io/http_content_length_test.dart b/tests/standalone/io/http_content_length_test.dart
index c42b8d33eabcfc8c73e1941f022237027526a1e2..1756a8753fdf7683a981d44c60d7115d330623e3 100644
--- a/tests/standalone/io/http_content_length_test.dart
+++ b/tests/standalone/io/http_content_length_test.dart
@@ -19,8 +19,8 @@ void testNoBody(int totalConnections, bool explicitContentLength) {
.then((_) {
Expect.fail("Unexpected successful response completion");
})
- .catchError((e) {
- Expect.isTrue(e.error is HttpException);
+ .catchError((error) {
+ Expect.isTrue(error is HttpException);
});
// write with content length 0 closes the connection and
// reports an error.
@@ -35,7 +35,10 @@ void testNoBody(int totalConnections, bool explicitContentLength) {
(e) => e is StateError);
},
onError: (e) {
- Expect.fail("Unexpected server error $e");
+ String msg = "Unexpected server error $e";
+ var trace = getAttachedStackTrace(e);
+ if (trace != null) msg += "\nStackTrace: $trace";
+ Expect.fail(msg);
});
int count = 0;
@@ -61,8 +64,11 @@ void testNoBody(int totalConnections, bool explicitContentLength) {
});
})
.catchError((e) {
- Expect.fail("Unexpected error $e");
- });
+ String msg = "Unexpected error $e";
+ var trace = getAttachedStackTrace(e);
+ if (trace != null) msg += "\nStackTrace: $trace";
+ Expect.fail(msg);
+ });
}
});
}
@@ -92,8 +98,8 @@ void testBody(int totalConnections, bool useHeader) {
.then((_) {
Expect.fail("Unexpected successful response completion");
})
- .catchError((e) {
- Expect.isTrue(e.error is HttpException, "[$e]");
+ .catchError((error) {
+ Expect.isTrue(error is HttpException, "[$error]");
if (++serverCount == totalConnections) {
server.close();
}
@@ -103,7 +109,12 @@ void testBody(int totalConnections, bool useHeader) {
(e) => e is StateError);
});
},
- onError: (e) => Expect.fail("Unexpected error $e"));
+ onError: (e) {
+ String msg = "Unexpected error $e";
+ var trace = getAttachedStackTrace(e);
+ if (trace != null) msg += "\nStackTrace: $trace";
+ Expect.fail(msg);
+ });
int clientCount = 0;
HttpClient client = new HttpClient();
@@ -168,7 +179,12 @@ void testBodyChunked(int totalConnections, bool useHeader) {
(e) => e is StateError);
});
},
- onError: (e) => Expect.fail("Unexpected error $e"));
+ onError: (e) {
+ String msg = "Unexpected error $e";
+ var trace = getAttachedStackTrace(e);
+ if (trace != null) msg += "\nStackTrace: $trace";
+ Expect.fail(msg);
+ });
int count = 0;
HttpClient client = new HttpClient();
@@ -201,7 +217,12 @@ void testBodyChunked(int totalConnections, bool useHeader) {
}
});
})
- .catchError((e) => Expect.fail("Unexpected error $e"));
+ .catchError((e) {
+ String msg = "Unexpected error $e";
+ var trace = getAttachedStackTrace(e);
+ if (trace != null) msg += "\nStackTrace: $trace";
+ Expect.fail(msg);
+ });
}
});
}
« no previous file with comments | « tests/standalone/io/http_10_test.dart ('k') | tests/standalone/io/http_redirect_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698