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

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

Issue 2857393003: Adding to a closed sink throws.
Patch Set: Rebase Created 3 years, 7 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/socket_exception_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 f65f4052623de76a9bd10d2d1fab40d47d7b9918..96dff03dae63ddfc7d85c223d980a7b255f0771b 100644
--- a/tests/standalone/io/http_content_length_test.dart
+++ b/tests/standalone/io/http_content_length_test.dart
@@ -37,7 +37,9 @@ void testNoBody(int totalConnections, bool explicitContentLength) {
// After an explicit close, write becomes a state error
// because we have said we will not add more.
response.close();
- response.write("x");
+ Expect.throws(() {
+ response.write("x");
+ }, (e) => e is StateError);
}, onError: (e, trace) {
String msg = "Unexpected server error $e";
if (trace != null) msg += "\nStackTrace: $trace";
@@ -89,7 +91,9 @@ void testBody(int totalConnections, bool useHeader) {
}
});
response.close();
- response.write("x");
+ Expect.throws(() {
+ response.write("x");
+ }, (e) => e is StateError);
});
}, onError: (e, trace) {
String msg = "Unexpected error $e";
@@ -149,7 +153,9 @@ void testBodyChunked(int totalConnections, bool useHeader) {
response.write("x");
response.write("x");
response.close();
- response.write("x");
+ Expect.throws(() {
+ response.write("x");
+ }, (e) => e is StateError);
});
}, onError: (e, trace) {
String msg = "Unexpected error $e";
« no previous file with comments | « tests/standalone/io/http_10_test.dart ('k') | tests/standalone/io/socket_exception_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698