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

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

Issue 10377124: Add a hash code to client and server web socket connections (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 7 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
« runtime/bin/websocket_impl.dart ('K') | « runtime/bin/websocket_impl.dart ('k') | no next file » | 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 7f2017c8f5023559dec8caf888338d1f5d020ffc..2eab3bace7b6c33f41d4c9a4e4ecd17174e675ad 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -150,6 +150,31 @@ void testUsePOST() {
}
+void testHashCode() {
Mads Ager (google) 2012/05/14 09:19:39 How about extending this with a case where you put
Søren Gjesse 2012/05/14 15:52:41 Done.
+ HttpServer server = new HttpServer();
+ HttpClient client = new HttpClient();
+
+ server.listen("127.0.0.1", 0, 5);
+
+ // Create a web socket handler and set is as the HTTP server default
+ // handler.
+ WebSocketHandler wsHandler = new WebSocketHandler();
+ wsHandler.onOpen = (WebSocketConnection conn) {
+ Expect.isNotNull(conn.hashCode());
+ conn.close();
+ };
+ server.defaultRequestHandler = wsHandler.onRequest;
+
+ HttpClientConnection conn = client.get("127.0.0.1", server.port, "/");
+ WebSocketClientConnection wsconn = new WebSocketClientConnection(conn);
+ Expect.isNotNull(wsconn.hashCode());
+ wsconn.onClosed = (status, reason) {
+ client.shutdown();
+ server.close();
+ };
+}
+
+
void testW3CInterface(
int totalConnections, int closeStatus, String closeReason) {
HttpServer server = new HttpServer();
@@ -232,6 +257,7 @@ main() {
testRequestResponseServerCloses(2, 3002, "Got tired");
testNoUpgrade();
testUsePOST();
+ testHashCode();
testW3CInterface(2, 3002, "Got tired");
}
« runtime/bin/websocket_impl.dart ('K') | « runtime/bin/websocket_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698