| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 import "dart:io"; | 6 import "dart:io"; |
| 7 | 7 |
| 8 String localFile(path) => Platform.script.resolve(path).toFilePath(); | 8 String localFile(path) => Platform.script.resolve(path).toFilePath(); |
| 9 | 9 |
| 10 bool printException(e) { print(e); return true; } | 10 bool printException(e) { print(e); return true; } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 Expect.throws(() => c.usePrivateKeySync( | 25 Expect.throws(() => c.usePrivateKeySync( |
| 26 localFile('certificates/server_key.pem'), password: "iHackSites"), | 26 localFile('certificates/server_key.pem'), password: "iHackSites"), |
| 27 tlsException); | 27 tlsException); |
| 28 Expect.throws(() => c.usePrivateKeySync( | 28 Expect.throws(() => c.usePrivateKeySync( |
| 29 localFile('certificates/server_key_oops.pem'), | 29 localFile('certificates/server_key_oops.pem'), |
| 30 password: "dartdart"), | 30 password: "dartdart"), |
| 31 fileSystemException); | 31 fileSystemException); |
| 32 Expect.throws(() => c.usePrivateKeySync(1), argumentOrTypeError); | 32 Expect.throws(() => c.usePrivateKeySync(1), argumentOrTypeError); |
| 33 Expect.throws(() => c.usePrivateKeySync(null), argumentError); | 33 Expect.throws(() => c.usePrivateKeySync(null), argumentError); |
| 34 Expect.throws(() => c.usePrivateKeySync( | 34 Expect.throws(() => c.usePrivateKeySync( |
| 35 localFile('certificates/server_key_oops.pem'), password: 3), | 35 localFile('certificates/server_key.pem'), password: 3), |
| 36 fileSystemException); | 36 argumentOrTypeError); |
| 37 c.usePrivateKeySync( | 37 c.usePrivateKeySync( |
| 38 localFile('certificates/server_key.pem'), password: "dartdart"); | 38 localFile('certificates/server_key.pem'), password: "dartdart"); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void main() { | 41 void main() { |
| 42 testUsePrivateKeyArguments(); | 42 testUsePrivateKeyArguments(); |
| 43 } | 43 } |
| OLD | NEW |