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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased to r18818 Created 7 years, 10 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_secure_test.dart
diff --git a/tests/standalone/io/web_socket_secure_test.dart b/tests/standalone/io/web_socket_secure_test.dart
deleted file mode 100644
index cb78bd39dd4769ff7682614a869e5c4254f7b1ef..0000000000000000000000000000000000000000
--- a/tests/standalone/io/web_socket_secure_test.dart
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "dart:io";
-import "dart:uri";
-import "dart:isolate";
-
-const SERVER_ADDRESS = "127.0.0.1";
-const HOST_NAME = "localhost";
-
-void test() {
- HttpsServer server = new HttpsServer();
- var client = new HttpClient();
-
- // Create a web socket handler and set it as the HTTP server default
- // handler.
- WebSocketHandler wsHandler = new WebSocketHandler();
- wsHandler.onOpen = (WebSocketConnection conn) {
- conn.onMessage = (Object message) => conn.send(message);
- conn.onClosed = (status, reason) {
- conn.close();
- server.close();
- client.shutdown();
- };
- };
- server.defaultRequestHandler = wsHandler.onRequest;
-
- server.onError = (Exception e) {
- Expect.fail("Unexpected error in Https Server: $e");
- };
-
- server.listen(SERVER_ADDRESS,
- 0,
- backlog: 5,
- certificate_name: "CN=$HOST_NAME");
-
- // Connect web socket over HTTPS.
- var conn = new WebSocketClientConnection(
- client.getUrl(
- Uri.parse("https://$HOST_NAME:${server.port}/")));
- conn.onOpen = () {
- conn.send("hello");
- };
- conn.onMessage = (msg) {
- Expect.equals("hello", msg);
- print(msg);
- conn.close();
- };
-
-}
-
-void InitializeSSL() {
- var testPkcertDatabase =
- new Path(new Options().script).directoryPath.append("pkcert/");
- SecureSocket.initialize(database: testPkcertDatabase.toNativePath(),
- password: "dartdart");
-}
-
-void main() {
- InitializeSSL();
- test();
-}
« no previous file with comments | « tests/standalone/io/web_socket_protocol_processor_test.dart ('k') | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698