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

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

Issue 10907047: Use onClosed instead of onError in the WebSocket classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review update. 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 6406dfb646d9b04e5bde0f8ae22118bf22181681..efff5f2006b126e39e3a2bc67be07ebe3bd8eb40 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -19,8 +19,8 @@ void testRequestResponseClientCloses(
var count = 0;
conn.onMessage = (Object message) => conn.send(message);
conn.onClosed = (status, reason) {
- Expect.equals(closeStatus, status);
- Expect.equals(closeReason, reason);
+ Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals(closeReason === null ? "" : closeReason, reason);
};
};
server.defaultRequestHandler = wsHandler.onRequest;
@@ -42,8 +42,8 @@ void testRequestResponseClientCloses(
}
};
wsconn.onClosed = (status, reason) {
- Expect.equals(closeStatus, status);
- Expect.isNull(reason);
+ Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals("", reason);
closeCount++;
if (closeCount == totalConnections) {
client.shutdown();
@@ -78,8 +78,8 @@ void testRequestResponseServerCloses(
}
};
conn.onClosed = (status, reason) {
- Expect.equals(closeStatus, status);
- Expect.isNull(reason);
+ Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals("", reason);
closeCount++;
if (closeCount == totalConnections) {
client.shutdown();
@@ -95,8 +95,8 @@ void testRequestResponseServerCloses(
WebSocketClientConnection wsconn = new WebSocketClientConnection(conn);
wsconn.onMessage = (message) => wsconn.send(message);
wsconn.onClosed = (status, reason) {
- Expect.equals(closeStatus, status);
- Expect.equals(closeReason, reason);
+ Expect.equals(closeStatus === null ? 1005 : closeStatus, status);
+ Expect.equals(closeReason === null ? "" : closeReason, reason);
};
}
}
@@ -263,7 +263,7 @@ void testW3CInterface(
};
conn.onClosed = (status, reason) {
Expect.equals(closeStatus, status);
- Expect.isNull(reason);
+ Expect.equals("", reason);
closeCount++;
if (closeCount == totalConnections) {
server.close();
« 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