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

Unified Diff: tests/html/websocket_test.dart

Issue 12465018: Expanding WebSocket test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | tools/testing/dart/http_server.dart » ('j') | tools/testing/dart/http_server.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/websocket_test.dart
diff --git a/tests/html/websocket_test.dart b/tests/html/websocket_test.dart
index 1738ecec8e1769f5d690c7252fca7d125a1e565d..752856c25199c5b8be55939df68688694667b6f3 100644
--- a/tests/html/websocket_test.dart
+++ b/tests/html/websocket_test.dart
@@ -24,5 +24,18 @@ main() {
expect(socket, isWebSocket);
}, expectation);
});
+
+ if (WebSocket.supported) {
+ test('echo', () {
+ var socket = new WebSocket('ws://${window.location.host}/ws', 'chat');
+ socket.onOpen.first.then((_) {
+ socket.send('hello!');
+ });
+
+ return socket.onMessage.first.then((MessageEvent e) {
+ expect(e.data, 'hello!');
+ });
+ });
+ }
});
}
« no previous file with comments | « no previous file | tools/testing/dart/http_server.dart » ('j') | tools/testing/dart/http_server.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698