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

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

Issue 13861005: Delay HttpClientResponse until HttpClientRequest is fully sent. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove test. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_close_test.dart » ('j') | 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) 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 import "dart:io"; 6 import "dart:io";
7 import "dart:isolate"; 7 import "dart:isolate";
8 import "dart:typeddata"; 8 import "dart:typeddata";
9 9
10 void testClientRequest(void handler(request)) { 10 void testClientRequest(void handler(request)) {
(...skipping 11 matching lines...) Expand all
22 }) 22 })
23 .then((response) { 23 .then((response) {
24 response.listen((_) {}, onDone: () { 24 response.listen((_) {}, onDone: () {
25 client.close(); 25 client.close();
26 server.close(); 26 server.close();
27 }); 27 });
28 }) 28 })
29 .catchError((error) { 29 .catchError((error) {
30 server.close(); 30 server.close();
31 client.close(); 31 client.close();
32 }, test: (e) => e is HttpParserException); 32 });
33 }); 33 });
34 } 34 }
35 35
36 void testResponseDone() { 36 void testResponseDone() {
37 testClientRequest((request) { 37 testClientRequest((request) {
38 request.close(); 38 request.close();
39 request.done.then((req) { 39 request.done.then((res1) {
40 Expect.equals(request, req); 40 request.response.then((res2) {
41 Expect.equals(res1, res2);
42 });
41 }); 43 });
42 return request.response; 44 return request.response;
43 }); 45 });
44 } 46 }
45 47
46 void testBadResponseAdd() { 48 void testBadResponseAdd() {
47 testClientRequest((request) { 49 testClientRequest((request) {
48 var port = new ReceivePort(); 50 var port = new ReceivePort();
49 request.contentLength = 0; 51 request.contentLength = 0;
50 request.writeBytes([0]); 52 request.writeBytes([0]);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 }, test: (e) => e is HttpException); 104 }, test: (e) => e is HttpException);
103 return request.response; 105 return request.response;
104 }); 106 });
105 } 107 }
106 108
107 void main() { 109 void main() {
108 testResponseDone(); 110 testResponseDone();
109 testBadResponseAdd(); 111 testBadResponseAdd();
110 testBadResponseClose(); 112 testBadResponseClose();
111 } 113 }
OLDNEW
« no previous file with comments | « sdk/lib/io/http_impl.dart ('k') | tests/standalone/io/http_close_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698