| OLD | NEW |
| 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 // This test tests TLS session resume, by making multiple client connections | |
| 6 // on the same port to the same server, with a delay of 200 ms between them. | |
| 7 // The unmodified secure_server_test creates all sessions simultaneously, | |
| 8 // which means that no handshake completes and caches its keys in the session | |
| 9 // cache in time for other connections to use it. | |
| 10 // | |
| 11 // Session resume is currently disabled - see issue | |
| 12 // https://code.google.com/p/dart/issues/detail?id=7230 | |
| 13 // | |
| 14 // VMOptions= | 5 // VMOptions= |
| 15 // VMOptions=--short_socket_read | 6 // VMOptions=--short_socket_read |
| 16 // VMOptions=--short_socket_write | 7 // VMOptions=--short_socket_write |
| 17 // VMOptions=--short_socket_read --short_socket_write | 8 // VMOptions=--short_socket_read --short_socket_write |
| 18 | 9 |
| 19 import "dart:async"; | 10 import "dart:async"; |
| 20 import "dart:io"; | 11 import "dart:io"; |
| 21 import "dart:isolate"; | 12 import "dart:isolate"; |
| 22 | 13 |
| 23 const SERVER_ADDRESS = "127.0.0.1"; | 14 const SERVER_ADDRESS = "127.0.0.1"; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 }); | 44 }); |
| 54 }); | 45 }); |
| 55 } | 46 } |
| 56 | 47 |
| 57 void main() { | 48 void main() { |
| 58 Path scriptDir = new Path(new Options().script).directoryPath; | 49 Path scriptDir = new Path(new Options().script).directoryPath; |
| 59 Path certificateDatabase = scriptDir.append('pkcert'); | 50 Path certificateDatabase = scriptDir.append('pkcert'); |
| 60 SecureSocket.initialize(database: certificateDatabase.toNativePath(), | 51 SecureSocket.initialize(database: certificateDatabase.toNativePath(), |
| 61 password: 'dartdart'); | 52 password: 'dartdart'); |
| 62 | 53 |
| 63 Duration delay = const Duration(milliseconds: 0); | |
| 64 Duration delay_between_connections = const Duration(milliseconds: 300); | |
| 65 | |
| 66 startServer() | 54 startServer() |
| 67 .then((server) => Future.wait( | 55 .then((server) => Future.wait( |
| 68 ['able', 'baker', 'charlie', 'dozen', 'elapse'] | 56 ['able', 'baker', 'charlie', 'dozen', 'elapse'] |
| 69 .map((name) { | 57 .map((name) => testClient(server, name)))) |
| 70 delay += delay_between_connections; | |
| 71 return new Future.delayed(delay, () => server) | |
| 72 .then((server) => testClient(server, name)); | |
| 73 }))) | |
| 74 .then((servers) => servers.first.close()); | 58 .then((servers) => servers.first.close()); |
| 75 } | 59 } |
| OLD | NEW |