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 // 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"; | 10 import "package:expect/expect.dart"; |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 if (listenSecure) { | 464 if (listenSecure) { |
465 RawSecureServerSocket.bind( | 465 RawSecureServerSocket.bind( |
466 HOST_NAME, 0, CERTIFICATE).then(serverReady); | 466 HOST_NAME, 0, CERTIFICATE).then(serverReady); |
467 } else { | 467 } else { |
468 RawServerSocket.bind(HOST_NAME, 0).then(serverReady); | 468 RawServerSocket.bind(HOST_NAME, 0).then(serverReady); |
469 } | 469 } |
470 } | 470 } |
471 | 471 |
472 main() { | 472 main() { |
473 Path scriptDir = new Path(new Options().script).directoryPath; | 473 Path scriptDir = new Path(Platform.script).directoryPath; |
474 Path certificateDatabase = scriptDir.append('pkcert'); | 474 Path certificateDatabase = scriptDir.append('pkcert'); |
475 SecureSocket.initialize(database: certificateDatabase.toNativePath(), | 475 SecureSocket.initialize(database: certificateDatabase.toNativePath(), |
476 password: 'dartdart', | 476 password: 'dartdart', |
477 useBuiltinRoots: false); | 477 useBuiltinRoots: false); |
478 testSimpleBind(); | 478 testSimpleBind(); |
479 testInvalidBind(); | 479 testInvalidBind(); |
480 testSimpleConnect(CERTIFICATE); | 480 testSimpleConnect(CERTIFICATE); |
481 testSimpleConnect("CN=localhost"); | 481 testSimpleConnect("CN=localhost"); |
482 testSimpleConnectFail("not_a_nickname", false); | 482 testSimpleConnectFail("not_a_nickname", false); |
483 testSimpleConnectFail("CN=notARealDistinguishedName", false); | 483 testSimpleConnectFail("CN=notARealDistinguishedName", false); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 connectSecure: true, | 518 connectSecure: true, |
519 handshakeBeforeSecure: false, | 519 handshakeBeforeSecure: false, |
520 postponeSecure: false, | 520 postponeSecure: false, |
521 dropReads: true); | 521 dropReads: true); |
522 testSimpleReadWrite(listenSecure: false, | 522 testSimpleReadWrite(listenSecure: false, |
523 connectSecure: false, | 523 connectSecure: false, |
524 handshakeBeforeSecure: true, | 524 handshakeBeforeSecure: true, |
525 postponeSecure: true, | 525 postponeSecure: true, |
526 dropReads: true); | 526 dropReads: true); |
527 } | 527 } |
OLD | NEW |