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

Side by Side Diff: tests/standalone/io/http_content_length_test.dart

Issue 12379039: Add exception information to help diagnose issue 8865 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "dart:isolate"; 5 import "dart:isolate";
6 import "dart:io"; 6 import "dart:io";
7 7
8 void testNoBody(int totalConnections, bool explicitContentLength) { 8 void testNoBody(int totalConnections, bool explicitContentLength) {
9 var errors = 0; 9 var errors = 0;
10 HttpServer.bind("127.0.0.1", 0, totalConnections).then((server) { 10 HttpServer.bind("127.0.0.1", 0, totalConnections).then((server) {
11 server.listen( 11 server.listen(
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 response.addString("x"); 84 response.addString("x");
85 Expect.throws(() => response.contentLength = 3, 85 Expect.throws(() => response.contentLength = 3,
86 (e) => e is HttpException); 86 (e) => e is HttpException);
87 response.addString("x"); 87 response.addString("x");
88 response.addString("x"); 88 response.addString("x");
89 response.done 89 response.done
90 .then((_) { 90 .then((_) {
91 Expect.fail("Unexpected successful response completion"); 91 Expect.fail("Unexpected successful response completion");
92 }) 92 })
93 .catchError((e) { 93 .catchError((e) {
94 Expect.isTrue(e.error is HttpException); 94 Expect.isTrue(e.error is HttpException, "[$e] [${e.error}] ");
95 }); 95 });
96 response.close(); 96 response.close();
97 Expect.throws(() => response.addString("x"), 97 Expect.throws(() => response.addString("x"),
98 (e) => e is StateError); 98 (e) => e is StateError);
99 }); 99 });
100 }, 100 },
101 onError: (e) => Expect.fail("Unexpected error $e")); 101 onError: (e) => Expect.fail("Unexpected error $e"));
102 102
103 int count = 0; 103 int count = 0;
104 HttpClient client = new HttpClient(); 104 HttpClient client = new HttpClient();
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 233
234 void main() { 234 void main() {
235 testNoBody(5, false); 235 testNoBody(5, false);
236 testNoBody(5, true); 236 testNoBody(5, true);
237 testBody(5, false); 237 testBody(5, false);
238 testBody(5, true); 238 testBody(5, true);
239 testBodyChunked(5, false); 239 testBodyChunked(5, false);
240 testBodyChunked(5, true); 240 testBodyChunked(5, true);
241 testHttp10(); 241 testHttp10();
242 } 242 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698