| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 if (listenSecure) { | 429 if (listenSecure) { |
| 430 RawSecureServerSocket.bind( | 430 RawSecureServerSocket.bind( |
| 431 HOST_NAME, 0, CERTIFICATE).then(serverReady); | 431 HOST_NAME, 0, CERTIFICATE).then(serverReady); |
| 432 } else { | 432 } else { |
| 433 RawServerSocket.bind(HOST_NAME, 0).then(serverReady); | 433 RawServerSocket.bind(HOST_NAME, 0).then(serverReady); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 main() { | 437 main() { |
| 438 Path scriptDir = new Path(new Options().script).directoryPath; | 438 Path scriptDir = new Path(Platform.script).directoryPath; |
| 439 Path certificateDatabase = scriptDir.append('pkcert'); | 439 Path certificateDatabase = scriptDir.append('pkcert'); |
| 440 SecureSocket.initialize(database: certificateDatabase.toNativePath(), | 440 SecureSocket.initialize(database: certificateDatabase.toNativePath(), |
| 441 password: 'dartdart', | 441 password: 'dartdart', |
| 442 useBuiltinRoots: false); | 442 useBuiltinRoots: false); |
| 443 testSimpleBind(); | 443 testSimpleBind(); |
| 444 testInvalidBind(); | 444 testInvalidBind(); |
| 445 testSimpleConnect(CERTIFICATE); | 445 testSimpleConnect(CERTIFICATE); |
| 446 testSimpleConnect("CN=localhost"); | 446 testSimpleConnect("CN=localhost"); |
| 447 testSimpleConnectFail("not_a_nickname", false); | 447 testSimpleConnectFail("not_a_nickname", false); |
| 448 testSimpleConnectFail("CN=notARealDistinguishedName", false); | 448 testSimpleConnectFail("CN=notARealDistinguishedName", false); |
| 449 testSimpleConnectFail("not_a_nickname", true); | 449 testSimpleConnectFail("not_a_nickname", true); |
| 450 testSimpleConnectFail("CN=notARealDistinguishedName", true); | 450 testSimpleConnectFail("CN=notARealDistinguishedName", true); |
| 451 testServerListenAfterConnect(); | 451 testServerListenAfterConnect(); |
| 452 testSimpleReadWrite(true, true, false); | 452 testSimpleReadWrite(true, true, false); |
| 453 testSimpleReadWrite(true, false, false); | 453 testSimpleReadWrite(true, false, false); |
| 454 testSimpleReadWrite(false, true, false); | 454 testSimpleReadWrite(false, true, false); |
| 455 testSimpleReadWrite(false, false, false); | 455 testSimpleReadWrite(false, false, false); |
| 456 testSimpleReadWrite(false, false, true, true); | 456 testSimpleReadWrite(false, false, true, true); |
| 457 testSimpleReadWrite(false, false, true, false); | 457 testSimpleReadWrite(false, false, true, false); |
| 458 } | 458 } |
| OLD | NEW |