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

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

Issue 15842004: Support auto-drain of HttpRequest data. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add documentation. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/standalone/io/http_server_response_test.dart ('k') | 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) 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:async'; 6 import 'dart:async';
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 const SESSION_ID = "DARTSESSID"; 9 const SESSION_ID = "DARTSESSID";
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 Expect.setEquals(new Set.from(clientSessions), sessions); 61 Expect.setEquals(new Set.from(clientSessions), sessions);
62 server.close(); 62 server.close();
63 client.close(); 63 client.close();
64 }); 64 });
65 }); 65 });
66 } 66 }
67 67
68 void testTimeout(int sessionCount) { 68 void testTimeout(int sessionCount) {
69 var client = new HttpClient(); 69 var client = new HttpClient();
70 HttpServer.bind("127.0.0.1", 0).then((server) { 70 HttpServer.bind("127.0.0.1", 0).then((server) {
71 server.sessionTimeout = 0; 71 server.sessionTimeout = 1;
72 var timeouts = []; 72 var timeouts = [];
73 server.listen((request) { 73 server.listen((request) {
74 var c = new Completer(); 74 var c = new Completer();
75 timeouts.add(c.future); 75 timeouts.add(c.future);
76 request.session.onTimeout = () { 76 request.session.onTimeout = () {
77 c.complete(null); 77 c.complete(null);
78 }; 78 };
79 request.response.close(); 79 request.response.close();
80 }); 80 });
81 81
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }); 191 });
192 }); 192 });
193 } 193 }
194 194
195 void main() { 195 void main() {
196 testSessions(1); 196 testSessions(1);
197 testTimeout(5); 197 testTimeout(5);
198 testSessionsData(); 198 testSessionsData();
199 testSessionsDestroy(); 199 testSessionsDestroy();
200 } 200 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_server_response_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698