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

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

Issue 16123036: Clean up dart:io exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2013, 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 25 matching lines...) Expand all
36 client.close(); 36 client.close();
37 } else { 37 } else {
38 received += data.length; 38 received += data.length;
39 } 39 }
40 }, 40 },
41 onDone: () { 41 onDone: () {
42 if (bytes != null) Expect.equals(received, bytes); 42 if (bytes != null) Expect.equals(received, bytes);
43 client.close(); 43 client.close();
44 }, 44 },
45 onError: (error) { 45 onError: (error) {
46 Expect.isTrue(error is HttpParserException); 46 Expect.isTrue(error is HttpException);
47 }); 47 });
48 }) 48 })
49 .catchError((error) { 49 .catchError((error) {
50 client.close(); 50 client.close();
51 }, test: (e) => e is HttpParserException); 51 }, test: (e) => e is HttpException);
52 }); 52 });
53 } 53 }
54 54
55 55
56 void testResponseDone() { 56 void testResponseDone() {
57 testServerRequest((server, request) { 57 testServerRequest((server, request) {
58 request.response.close(); 58 request.response.close();
59 request.response.done.then((response) { 59 request.response.done.then((response) {
60 Expect.equals(request.response, response); 60 Expect.equals(request.response, response);
61 server.close(); 61 server.close();
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 void main() { 274 void main() {
275 testResponseDone(); 275 testResponseDone();
276 testResponseAddStream(); 276 testResponseAddStream();
277 testResponseAddStreamClosed(); 277 testResponseAddStreamClosed();
278 testResponseAddClosed(); 278 testResponseAddClosed();
279 testBadResponseAdd(); 279 testBadResponseAdd();
280 testBadResponseClose(); 280 testBadResponseClose();
281 testIgnoreRequestData(); 281 testIgnoreRequestData();
282 } 282 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_redirect_test.dart ('k') | tests/standalone/io/http_shutdown_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698