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

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

Issue 12317147: Implement addStream for HttpClientRequest/HttpResponse and propegate all write-errors from the sock… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Extend test. 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 | « sdk/lib/io/io_stream_consumer.dart ('k') | tests/standalone/io/http_server_response_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 //
5 // VMOptions=
6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write
4 9
5 import "dart:io"; 10 import "dart:io";
6 import "dart:uri"; 11 import "dart:uri";
7 12
8 void main() { 13 void main() {
9 final int REQUEST_COUNT = 100; 14 final int REQUEST_COUNT = 100;
10 int count = 0; 15 int count = 0;
11 HttpServer.bind().then((server) { 16 HttpServer.bind().then((server) {
12 server.listen((HttpRequest request) { 17 server.listen((HttpRequest request) {
13 count++; 18 count++;
14 request.response.addString(request.uri.path); 19 request.response.addString(request.uri.path);
15 request.response.close(); 20 request.response.close();
16 if (request.uri.path == "/done") { 21 if (request.uri.path == "/done") {
17 request.response.done.then((_) { 22 request.response.done.then((_) {
18 Expect.equals(REQUEST_COUNT + 1, count); 23 Expect.equals(REQUEST_COUNT + 1, count);
19 server.close(); 24 server.close();
20 }); 25 });
21 } 26 }
22 }); 27 });
23 Socket.connect("127.0.0.1", server.port).then((s) { 28 Socket.connect("127.0.0.1", server.port).then((s) {
24 s.listen((data) { }); 29 s.listen((data) { });
25 for (int i = 0; i < REQUEST_COUNT; i++) { 30 for (int i = 0; i < REQUEST_COUNT; i++) {
26 s.addString("GET /$i HTTP/1.1\r\nX-Header-1: 111\r\n\r\n"); 31 s.addString("GET /$i HTTP/1.1\r\nX-Header-1: 111\r\n\r\n");
27 } 32 }
28 s.addString("GET /done HTTP/1.1\r\nConnection: close\r\n\r\n"); 33 s.addString("GET /done HTTP/1.1\r\nConnection: close\r\n\r\n");
29 s.close(); 34 s.close();
30 }); 35 });
31 }); 36 });
32 } 37 }
OLDNEW
« no previous file with comments | « sdk/lib/io/io_stream_consumer.dart ('k') | tests/standalone/io/http_server_response_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698