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

Unified Diff: pkg/http/test/utils.dart

Issue 11821018: Fix a bug in pkg/http where exceptions were getting top-leveled. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« pkg/http/test/client_test.dart ('K') | « pkg/http/test/client_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/test/utils.dart
diff --git a/pkg/http/test/utils.dart b/pkg/http/test/utils.dart
index 53ff769bbf68a1a16a3a2ab3250cbbf85e75e074..003cf398bbe1577f80a68a4e4c24ea2fd4568d76 100644
--- a/pkg/http/test/utils.dart
+++ b/pkg/http/test/utils.dart
@@ -178,3 +178,15 @@ class _RedirectLimitExceededException extends TypeMatcher {
bool matches(item, MatchState matchState) =>
item is RedirectLimitExceededException;
}
+
+/// A matcher for SocketIOExceptions.
+const isSocketIOException = const _SocketIOException();
+
+/// A matcher for functions that throw SocketIOException.
+const Matcher throwsSocketIOException =
+ const Throws(isSocketIOException);
+
+class _SocketIOException extends TypeMatcher {
+ const _SocketIOException() : super("SocketIOException");
+ bool matches(item, MatchState matchState) => item is SocketIOException;
+}
« pkg/http/test/client_test.dart ('K') | « pkg/http/test/client_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698