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

Unified Diff: tools/testing/dart/http_server.dart

Issue 1513363003: fix safari test (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/html/websocket_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/http_server.dart
diff --git a/tools/testing/dart/http_server.dart b/tools/testing/dart/http_server.dart
index 7f5fae75bc4dee64baf58831ba2bf50a50a5af10..843aaafe9be59ed0fed6c6e78cba3746325d19dc 100644
--- a/tools/testing/dart/http_server.dart
+++ b/tools/testing/dart/http_server.dart
@@ -260,7 +260,13 @@ class TestingServers {
websocket.done.catchError((_) {});
websocket.listen((data) {
websocket.add(data);
- websocket.close();
+ if (data == 'close-with-error') {
+ // Note: according to the web-sockets spec, a reason longer than 123
+ // bytes will produce a SyntaxError on the client.
+ websocket.close(WebSocketStatus.UNSUPPORTED_DATA, 'X' * 124);
+ } else {
+ websocket.close();
+ }
}, onError: (e) {
DebugLogger.warning('HttpServer: error while echoing to WebSocket', e);
});
« no previous file with comments | « tests/html/websocket_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698