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

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

Issue 10946007: Never send reserved status codes in a close frame (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « 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 efff5f2006b126e39e3a2bc67be07ebe3bd8eb40..7cde41e390fa24c4e8a76baec8771e465f332063 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -19,7 +19,9 @@ void testRequestResponseClientCloses(
var count = 0;
conn.onMessage = (Object message) => conn.send(message);
conn.onClosed = (status, reason) {
- Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals(closeStatus === null
+ ? WebSocketStatus.NO_STATUS_RECEIVED
+ : closeStatus, status);
Expect.equals(closeReason === null ? "" : closeReason, reason);
};
};
@@ -42,7 +44,9 @@ void testRequestResponseClientCloses(
}
};
wsconn.onClosed = (status, reason) {
- Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals(closeStatus === null
+ ? WebSocketStatus.NO_STATUS_RECEIVED
+ : closeStatus, status);
Expect.equals("", reason);
closeCount++;
if (closeCount == totalConnections) {
@@ -78,7 +82,9 @@ void testRequestResponseServerCloses(
}
};
conn.onClosed = (status, reason) {
- Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals(closeStatus === null
+ ? WebSocketStatus.NO_STATUS_RECEIVED
+ : closeStatus, status);
Expect.equals("", reason);
closeCount++;
if (closeCount == totalConnections) {
@@ -95,7 +101,9 @@ void testRequestResponseServerCloses(
WebSocketClientConnection wsconn = new WebSocketClientConnection(conn);
wsconn.onMessage = (message) => wsconn.send(message);
wsconn.onClosed = (status, reason) {
- Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals(closeStatus === null
+ ? WebSocketStatus.NO_STATUS_RECEIVED
+ : closeStatus, status);
Expect.equals(closeReason === null ? "" : closeReason, reason);
};
}
« no previous file with comments | « runtime/bin/websocket_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698