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

Unified Diff: tests/standalone/io/web_socket_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
« no previous file with comments | « tests/standalone/io/web_socket_protocol_processor_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/web_socket_test.dart
diff --git a/tests/standalone/io/web_socket_test.dart b/tests/standalone/io/web_socket_test.dart
index ae383078ac65438245cc8227fdf09b390a5a2727..695b2cd0a3b68ba80d7d4c3ff367e755d2ecb0da 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -19,9 +19,18 @@ import "package:path/path.dart";
const WEB_SOCKET_GUID = "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.
*/
@@ -33,13 +42,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 client context argument to WebSocket.connect
WebSocket.connect('${secure ? "wss" : "ws"}://$HOST_NAME:$port/');
checkCloseStatus(webSocket, closeStatus, closeReason) {
@@ -581,15 +591,8 @@ class SecurityConfiguration {
}
-void initializeSSL() {
- var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
- SecureSocket.initialize(database: testPkcertDatabase,
- password: "dartdart");
-}
-
-
main() {
new SecurityConfiguration(secure: false).runTests();
- initializeSSL();
- new SecurityConfiguration(secure: true).runTests();
+ // TODO(whesse): Make WebSocket.connect() take an optional context: parameter.
+ // new SecurityConfiguration(secure: true).runTests();
}
« no previous file with comments | « tests/standalone/io/web_socket_protocol_processor_test.dart ('k') | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698