Index: tests/standalone/io/security_context_argument_test.dart |
diff --git a/tests/standalone/io/security_context_argument_test.dart b/tests/standalone/io/security_context_argument_test.dart |
index 4048afd4f4d002b4725e6d45f16667e42cb562ef..a964f8c690d042173af3cd52ebbb6111e540860f 100644 |
--- a/tests/standalone/io/security_context_argument_test.dart |
+++ b/tests/standalone/io/security_context_argument_test.dart |
@@ -6,7 +6,6 @@ import "package:expect/expect.dart"; |
import "dart:io"; |
String localFile(path) => Platform.script.resolve(path).toFilePath(); |
-List<int> readLocalFile(path) => (new File(localFile(path))).readAsBytesSync(); |
bool printException(e) { print(e); return true; } |
bool argumentError(e) => e is ArgumentError; |
@@ -16,28 +15,27 @@ bool tlsException(e) => e is TlsException; |
void testUsePrivateKeyArguments() { |
var c = new SecurityContext(); |
- c.useCertificateChainBytes(readLocalFile('certificates/server_chain.pem')); |
- Expect.throws(() => c.usePrivateKeyBytes( |
- readLocalFile('certificates/server_key.pem'), |
- password: "dart" * 1000), |
+ c.useCertificateChainSync(localFile('certificates/server_chain.pem')); |
+ Expect.throws(() => c.usePrivateKeySync( |
+ localFile('certificates/server_key.pem'), password: "dart" * 1000), |
argumentError); |
- Expect.throws(() => c.usePrivateKeyBytes( |
- readLocalFile('certificates/server_key.pem')), |
+ Expect.throws(() => c.usePrivateKeySync( |
+ localFile('certificates/server_key.pem')), |
tlsException); |
- Expect.throws(() => c.usePrivateKeyBytes( |
- readLocalFile('certificates/server_key.pem'), password: "iHackSites"), |
+ Expect.throws(() => c.usePrivateKeySync( |
+ localFile('certificates/server_key.pem'), password: "iHackSites"), |
tlsException); |
- Expect.throws(() => c.usePrivateKeyBytes( |
- readLocalFile('certificates/server_key_oops.pem'), |
- password: "dartdart"), |
+ Expect.throws(() => c.usePrivateKeySync( |
+ localFile('certificates/server_key_oops.pem'), |
+ password: "dartdart"), |
fileSystemException); |
- Expect.throws(() => c.usePrivateKeyBytes(1), argumentOrTypeError); |
- Expect.throws(() => c.usePrivateKeyBytes(null), argumentError); |
- Expect.throws(() => c.usePrivateKeyBytes( |
- readLocalFile('certificates/server_key_oops.pem'), password: 3), |
+ Expect.throws(() => c.usePrivateKeySync(1), argumentOrTypeError); |
+ Expect.throws(() => c.usePrivateKeySync(null), argumentError); |
+ Expect.throws(() => c.usePrivateKeySync( |
+ localFile('certificates/server_key_oops.pem'), password: 3), |
fileSystemException); |
- c.usePrivateKeyBytes( |
- readLocalFile('certificates/server_key.pem'), password: "dartdart"); |
+ c.usePrivateKeySync( |
+ localFile('certificates/server_key.pem'), password: "dartdart"); |
} |
void main() { |