Chromium Code Reviews| 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"); |
| } |