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

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

Issue 1133673006: Make sure to process WebSocket frames when closing a WebSocket (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 5 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
« no previous file with comments | « tests/standalone/io/web_socket_pipe_test.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 97059042e1d5db5aa0b862adfd055ad70b0f6249..f3213e672572008a5ff98e33d50dca8e06852575 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -173,6 +173,36 @@ class SecurityConfiguration {
}
+ void testCloseNoListen() {
+ createServer().then((server) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
+ server.close();
+ webSocket.close();
+ });
+
+ createClient(server.port).then((webSocket) {
+ webSocket.close();
+ });
+ });
+ }
+
+
+ void testListenAfterClose() {
+ createServer().then((server) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
+ server.close();
+ webSocket.close();
+ Expect.throws(() => webSocket.drain());
+ });
+
+ createClient(server.port).then((webSocket) {
+ webSocket.close();
+ Expect.throws(() => webSocket.drain());
+ });
+ });
+ }
+
+
void testDoubleCloseClient() {
createServer().then((server) {
server.transform(new WebSocketTransformer()).listen((webSocket) {
@@ -208,10 +238,10 @@ class SecurityConfiguration {
server.listen((request) {
WebSocketTransformer.upgrade(request)
.then((webSocket) {
- webSocket.close();
webSocket.listen(
(_) { Expect.fail("Unexpected message"); },
onDone: server.close);
+ webSocket.close();
});
});
@@ -239,10 +269,10 @@ class SecurityConfiguration {
});
createClient(server.port).then((webSocket) {
- webSocket.close();
webSocket.listen(
(_) { Expect.fail("Unexpected message"); },
onDone: webSocket.close);
+ webSocket.close();
});
});
}
@@ -512,6 +542,8 @@ class SecurityConfiguration {
testMessageLength(127);
testMessageLength(65535);
testMessageLength(65536);
+ testCloseNoListen();
+ testListenAfterClose();
testDoubleCloseClient();
testDoubleCloseServer();
testImmediateCloseServer();
« no previous file with comments | « tests/standalone/io/web_socket_pipe_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698