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 // TODO(7157): Remove this test once the bug is fixed. | 6 // TODO(7157): Remove this test once the bug is fixed. |
7 // This is a copy of web_socket_test.dart with the secure connection | 7 // This is a copy of web_socket_test.dart with the secure connection |
8 // tests disabled, so it does not crash on Windows. | 8 // tests disabled, so it does not crash on Windows. |
9 import "dart:async"; | 9 import "dart:async"; |
10 import "dart:io"; | 10 import "dart:io"; |
(...skipping 24 matching lines...) Expand all Loading... |
35 server.listen(SERVER_ADDRESS, | 35 server.listen(SERVER_ADDRESS, |
36 0, | 36 0, |
37 backlog: backlog, | 37 backlog: backlog, |
38 certificate_name: "CN=$HOST_NAME"); | 38 certificate_name: "CN=$HOST_NAME"); |
39 return server; | 39 return server; |
40 } | 40 } |
41 | 41 |
42 WebSocketClientConnection createClient(int port, | 42 WebSocketClientConnection createClient(int port, |
43 {bool followRedirects, | 43 {bool followRedirects, |
44 String method: "GET"}) { | 44 String method: "GET"}) { |
45 HttpClientConnection conn = client.openUrl(method, new Uri.fromString( | 45 HttpClientConnection conn = client.openUrl(method, Uri.parse( |
46 '${secure ? "https" : "http"}://$HOST_NAME:$port/')); | 46 '${secure ? "https" : "http"}://$HOST_NAME:$port/')); |
47 if (followRedirects != null) { | 47 if (followRedirects != null) { |
48 conn.followRedirects = followRedirects; | 48 conn.followRedirects = followRedirects; |
49 } | 49 } |
50 return new WebSocketClientConnection(conn); | 50 return new WebSocketClientConnection(conn); |
51 } | 51 } |
52 | 52 |
53 void testRequestResponseClientCloses( | 53 void testRequestResponseClientCloses( |
54 int totalConnections, int closeStatus, String closeReason) { | 54 int totalConnections, int closeStatus, String closeReason) { |
55 HttpServer server = createServer(backlog: totalConnections); | 55 HttpServer server = createServer(backlog: totalConnections); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 var testPkcertDatabase = | 371 var testPkcertDatabase = |
372 new Path(new Options().script).directoryPath.append("pkcert/"); | 372 new Path(new Options().script).directoryPath.append("pkcert/"); |
373 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), | 373 SecureSocket.initialize(database: testPkcertDatabase.toNativePath(), |
374 password: "dartdart"); | 374 password: "dartdart"); |
375 } | 375 } |
376 | 376 |
377 | 377 |
378 main() { | 378 main() { |
379 new SecurityConfiguration(secure: false).runTests(); | 379 new SecurityConfiguration(secure: false).runTests(); |
380 } | 380 } |
OLD | NEW |