| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #import("dart:math"); | 5 import "dart:math"; |
| 6 | 6 |
| 7 #source("../../../lib/io/websocket.dart"); | 7 part "../../../sdk/lib/io/websocket.dart"; |
| 8 #source("../../../lib/io/websocket_impl.dart"); | 8 part "../../../sdk/lib/io/websocket_impl.dart"; |
| 9 | 9 |
| 10 class WebSocketFrame { | 10 class WebSocketFrame { |
| 11 WebSocketFrame(int opcode, List<int> data); | 11 WebSocketFrame(int opcode, List<int> data); |
| 12 } | 12 } |
| 13 | 13 |
| 14 // Class that when hooked up to the web socket protocol processor will | 14 // Class that when hooked up to the web socket protocol processor will |
| 15 // collect the message and expect it to be equal to the | 15 // collect the message and expect it to be equal to the |
| 16 // expectedMessage field when fully received. | 16 // expectedMessage field when fully received. |
| 17 class WebSocketMessageCollector { | 17 class WebSocketMessageCollector { |
| 18 WebSocketMessageCollector(_WebSocketProtocolProcessor this.processor, | 18 WebSocketMessageCollector(_WebSocketProtocolProcessor this.processor, |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 runTest(65534, 65537, 1); | 213 runTest(65534, 65537, 1); |
| 214 print("Fragment messages test, messages $messageCount, frames $frameCount"); | 214 print("Fragment messages test, messages $messageCount, frames $frameCount"); |
| 215 Expect.equals(messageCount, mc.messageCount); | 215 Expect.equals(messageCount, mc.messageCount); |
| 216 Expect.equals(0, mc.closeCount); | 216 Expect.equals(0, mc.closeCount); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void main() { | 219 void main() { |
| 220 testFullMessages(); | 220 testFullMessages(); |
| 221 testFragmentedMessages(); | 221 testFragmentedMessages(); |
| 222 } | 222 } |
| OLD | NEW |