OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "dart:async"; | 6 import "dart:async"; |
7 import "dart:io"; | 7 import "dart:io"; |
8 import "dart:isolate"; | 8 import "dart:isolate"; |
9 import "dart:scalarlist"; | 9 import "dart:scalarlist"; |
10 import "dart:uri"; | 10 import "dart:uri"; |
(...skipping 21 matching lines...) Expand all Loading... |
32 server.listen(SERVER_ADDRESS, | 32 server.listen(SERVER_ADDRESS, |
33 0, | 33 0, |
34 backlog: backlog, | 34 backlog: backlog, |
35 certificate_name: "CN=$HOST_NAME"); | 35 certificate_name: "CN=$HOST_NAME"); |
36 return server; | 36 return server; |
37 } | 37 } |
38 | 38 |
39 WebSocketClientConnection createClient(int port, | 39 WebSocketClientConnection createClient(int port, |
40 {bool followRedirects, | 40 {bool followRedirects, |
41 String method: "GET"}) { | 41 String method: "GET"}) { |
42 HttpClientConnection conn = client.openUrl(method, new Uri.fromString( | 42 HttpClientConnection conn = client.openUrl(method, Uri.parse( |
43 '${secure ? "https" : "http"}://$HOST_NAME:$port/')); | 43 '${secure ? "https" : "http"}://$HOST_NAME:$port/')); |
44 if (followRedirects != null) { | 44 if (followRedirects != null) { |
45 conn.followRedirects = followRedirects; | 45 conn.followRedirects = followRedirects; |
46 } | 46 } |
47 return new WebSocketClientConnection(conn); | 47 return new WebSocketClientConnection(conn); |
48 } | 48 } |
49 | 49 |
50 void testRequestResponseClientCloses( | 50 void testRequestResponseClientCloses( |
51 int totalConnections, int closeStatus, String closeReason) { | 51 int totalConnections, int closeStatus, String closeReason) { |
52 HttpServer server = createServer(backlog: totalConnections); | 52 HttpServer server = createServer(backlog: totalConnections); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), | 370 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), |
371 password: "dartdart"); | 371 password: "dartdart"); |
372 } | 372 } |
373 | 373 |
374 | 374 |
375 main() { | 375 main() { |
376 new SecurityConfiguration(secure: false).runTests(); | 376 new SecurityConfiguration(secure: false).runTests(); |
377 initializeSSL(); | 377 initializeSSL(); |
378 new SecurityConfiguration(secure: true).runTests(); | 378 new SecurityConfiguration(secure: true).runTests(); |
379 } | 379 } |
OLD | NEW |