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

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

Issue 13686005: WebSocket: Correctly expect masked frames from clients, and send masked frames from the client. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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_protocol_processor_test.dart
diff --git a/tests/standalone/io/web_socket_protocol_processor_test.dart b/tests/standalone/io/web_socket_protocol_processor_test.dart
index 36eeeed404c78307c37d110cc402e125b5ceba7b..54a7c129781efa6366a78401edeaec7d2867397f 100644
--- a/tests/standalone/io/web_socket_protocol_processor_test.dart
+++ b/tests/standalone/io/web_socket_protocol_processor_test.dart
@@ -8,6 +8,7 @@ import "dart:math";
import "dart:async";
import "dart:collection";
import "dart:typeddata";
+import "dart:isolate";
part "../../../sdk/lib/io/http.dart";
part "../../../sdk/lib/io/buffer_list.dart";
@@ -226,7 +227,22 @@ void testFragmentedMessages() {
Expect.equals(0, mc.closeCount);
}
+void testUnmaskedMessage() {
+ var transformer = new _WebSocketProtocolTransformer(true);
+ var controller = new StreamController();
+ var port = new ReceivePort();
+ controller.stream.transform(transformer).listen((_) {}, onError: (e) {
+ port.close();
+ });
+ var message = new Uint8List(10);
+ List<int> frame = createFrame(
+ true, FRAME_OPCODE_BINARY, null, message, 0, message.length);
+ controller.add(frame);
+}
+
+
void main() {
testFullMessages();
testFragmentedMessages();
+ testUnmaskedMessage();
}
« 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