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

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

Issue 23074008: Only change timeout to 100ms after the connection is established. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Few fixes. Created 7 years, 4 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) 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";
11 import "dart:async"; 10 import "dart:async";
12 import "dart:io"; 11 import "dart:io";
13 import "dart:isolate"; 12 import "dart:isolate";
14 13
15 14
16 void testTimeoutAfterRequest() { 15 void testTimeoutAfterRequest() {
17 HttpServer.bind("127.0.0.1", 0).then((server) { 16 HttpServer.bind("127.0.0.1", 0).then((server) {
18 server.idleTimeout = const Duration(milliseconds: 100); 17 server.idleTimeout = null;
19 18
20 server.listen((request) => request.response.close()); 19 server.listen((request) {
20 server.idleTimeout = const Duration(milliseconds: 100);
21 request.response.close();
22 });
21 23
22 Socket.connect("127.0.0.1", server.port).then((socket) { 24 Socket.connect("127.0.0.1", server.port).then((socket) {
23 var data = "GET / HTTP/1.1\r\nContent-Length: 0\r\n\r\n"; 25 var data = "GET / HTTP/1.1\r\nContent-Length: 0\r\n\r\n";
24 socket.write(data); 26 socket.write(data);
25 socket.listen( 27 socket.listen(
26 null, 28 null,
27 onDone: () { 29 onDone: () {
28 socket.close(); 30 socket.close();
29 server.close(); 31 server.close();
30 }); 32 });
(...skipping 15 matching lines...) Expand all
46 server.close(); 48 server.close();
47 }); 49 });
48 }); 50 });
49 }); 51 });
50 } 52 }
51 53
52 void main() { 54 void main() {
53 testTimeoutAfterRequest(); 55 testTimeoutAfterRequest();
54 testTimeoutBeforeRequest(); 56 testTimeoutBeforeRequest();
55 } 57 }
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