Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: tests/standalone/io/web_socket_error_test.dart

Issue 1319703002: Breaking Change: merge BoringSSL branch into master (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/standalone/io/web_socket_error_test.dart
diff --git a/tests/standalone/io/web_socket_error_test.dart b/tests/standalone/io/web_socket_error_test.dart
index 7081dca75d0e24abd25601f7b9338776d4fcd7ad..cc16bde50f693029fad0be59ab9905b8448ca57b 100644
--- a/tests/standalone/io/web_socket_error_test.dart
+++ b/tests/standalone/io/web_socket_error_test.dart
@@ -25,6 +25,16 @@ const String webSocketGUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
const String CERT_NAME = 'localhost_cert';
const String HOST_NAME = 'localhost';
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+ ..useCertificateChain(localFile('certificates/server_chain.pem'))
+ ..usePrivateKey(localFile('certificates/server_key.pem'),
+ password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+ ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
/**
* A SecurityConfiguration lets us run the tests over HTTP or HTTPS.
*/
@@ -36,13 +46,14 @@ class SecurityConfiguration {
Future<HttpServer> createServer({int backlog: 0}) =>
secure ? HttpServer.bindSecure(HOST_NAME,
0,
- backlog: backlog,
- certificateName: CERT_NAME)
+ serverContext,
+ backlog: backlog)
: HttpServer.bind(HOST_NAME,
0,
backlog: backlog);
Future<WebSocket> createClient(int port) =>
+ // TODO(whesse): Add a client context argument to WebSocket.connect.
WebSocket.connect('${secure ? "wss" : "ws"}://$HOST_NAME:$port/');
@@ -89,18 +100,11 @@ class SecurityConfiguration {
}
-void initializeSSL() {
- var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
- SecureSocket.initialize(database: testPkcertDatabase,
- password: "dartdart");
-}
-
-
main() {
asyncStart();
new SecurityConfiguration(secure: false).runTests();
- initializeSSL();
- new SecurityConfiguration(secure: true).runTests();
+ // TODO(whesse): WebSocket.connect needs an optional context: parameter
+ // new SecurityConfiguration(secure: true).runTests();
asyncEnd();
}
« no previous file with comments | « tests/standalone/io/socket_upgrade_to_secure_test.dart ('k') | tests/standalone/io/web_socket_protocol_processor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698