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

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

Issue 14640008: Change the signature for all network bind calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments by whesse@ 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
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 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 import "dart:isolate"; 7 import "dart:isolate";
8 import "dart:io"; 8 import "dart:io";
9 9
10 void setConnectionHeaders(HttpHeaders headers) { 10 void setConnectionHeaders(HttpHeaders headers) {
(...skipping 14 matching lines...) Expand all
25 if (persistentConnection) { 25 if (persistentConnection) {
26 Expect.equals(2, headers[HttpHeaders.CONNECTION].length); 26 Expect.equals(2, headers[HttpHeaders.CONNECTION].length);
27 } else { 27 } else {
28 Expect.equals(3, headers[HttpHeaders.CONNECTION].length); 28 Expect.equals(3, headers[HttpHeaders.CONNECTION].length);
29 Expect.isTrue(headers[HttpHeaders.CONNECTION].any( 29 Expect.isTrue(headers[HttpHeaders.CONNECTION].any(
30 (value) => value.toLowerCase() == "close")); 30 (value) => value.toLowerCase() == "close"));
31 } 31 }
32 } 32 }
33 33
34 void test(int totalConnections, bool clientPersistentConnection) { 34 void test(int totalConnections, bool clientPersistentConnection) {
35 HttpServer.bind().then((server) { 35 HttpServer.bind("127.0.0.1", 0).then((server) {
36 server.listen((HttpRequest request) { 36 server.listen((HttpRequest request) {
37 // Check expected request. 37 // Check expected request.
38 Expect.equals(clientPersistentConnection, request.persistentConnection); 38 Expect.equals(clientPersistentConnection, request.persistentConnection);
39 Expect.equals(clientPersistentConnection, 39 Expect.equals(clientPersistentConnection,
40 request.response.persistentConnection); 40 request.response.persistentConnection);
41 checkExpectedConnectionHeaders(request.headers, 41 checkExpectedConnectionHeaders(request.headers,
42 request.persistentConnection); 42 request.persistentConnection);
43 43
44 // Generate response. If the client signaled non-persistent 44 // Generate response. If the client signaled non-persistent
45 // connection the server should not need to set it. 45 // connection the server should not need to set it.
(...skipping 27 matching lines...) Expand all
73 }); 73 });
74 } 74 }
75 }); 75 });
76 } 76 }
77 77
78 78
79 void main() { 79 void main() {
80 test(2, false); 80 test(2, false);
81 test(2, true); 81 test(2, true);
82 } 82 }
OLDNEW
« no previous file with comments | « tests/standalone/io/http_connection_close_test.dart ('k') | tests/standalone/io/http_content_length_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698