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

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

Issue 1234163002: Fix a WebSocket crash. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review changes Created 5 years, 5 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 | « sdk/lib/io/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 f3213e672572008a5ff98e33d50dca8e06852575..9ae175815ac65e4cf21560906f2598529e5b2207 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -187,6 +187,36 @@ class SecurityConfiguration {
}
+ void testCancelThenClose() {
+ createServer().then((server) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
+ webSocket.listen(null).cancel();
+ webSocket.close();
+ server.close();
+ });
+
+ createClient(server.port).then((webSocket) {
+ webSocket.close();
+ });
+ });
+ }
+
+ void testCloseThenCancel() {
+ createServer().then((server) {
+ server.transform(new WebSocketTransformer()).listen((webSocket) {
+ var subscription = webSocket.listen(null);
+ webSocket.close();
+ subscription.cancel();
+ server.close();
+ });
+
+ createClient(server.port).then((webSocket) {
+ webSocket.close();
+ });
+ });
+ }
+
+
void testListenAfterClose() {
createServer().then((server) {
server.transform(new WebSocketTransformer()).listen((webSocket) {
@@ -543,6 +573,8 @@ class SecurityConfiguration {
testMessageLength(65535);
testMessageLength(65536);
testCloseNoListen();
+ testCancelThenClose();
+ testCloseThenCancel();
testListenAfterClose();
testDoubleCloseClient();
testDoubleCloseServer();
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698