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

Side by Side Diff: tests/standalone/io/web_socket_pipe_test.dart

Issue 1133673006: Make sure to process WebSocket frames when closing a WebSocket (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 5 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // VMOptions= 5 // VMOptions=
6 // VMOptions=--short_socket_read 6 // VMOptions=--short_socket_read
7 // VMOptions=--short_socket_write 7 // VMOptions=--short_socket_write
8 // VMOptions=--short_socket_read --short_socket_write 8 // VMOptions=--short_socket_read --short_socket_write
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 22 matching lines...) Expand all
33 WebSocket.connect("ws://127.0.0.1:${server.port}/").then((client) { 33 WebSocket.connect("ws://127.0.0.1:${server.port}/").then((client) {
34 var count = 0; 34 var count = 0;
35 next() { 35 next() {
36 if (count < messages) { 36 if (count < messages) {
37 client.add("Hello"); 37 client.add("Hello");
38 } else { 38 } else {
39 client.close(); 39 client.close();
40 } 40 }
41 } 41 }
42 42
43 next();
44 client.listen( 43 client.listen(
45 (data) { 44 (data) {
46 count++; 45 count++;
47 if (transform) { 46 if (transform) {
48 Expect.equals("olleH", data); 47 Expect.equals("olleH", data);
49 } else { 48 } else {
50 Expect.equals("Hello", data); 49 Expect.equals("Hello", data);
51 } 50 }
52 next(); 51 next();
53 }, 52 },
54 onDone: () => print("Client received close")); 53 onDone: () => print("Client received close"));
54
55 next();
55 }); 56 });
56 }); 57 });
57 } 58 }
58 59
59 void main() { 60 void main() {
60 testPipe(messages: 0, transform: false); 61 testPipe(messages: 0, transform: false);
61 testPipe(messages: 0, transform: true); 62 testPipe(messages: 0, transform: true);
62 testPipe(messages: 1, transform: false); 63 testPipe(messages: 1, transform: false);
63 testPipe(messages: 1, transform: true); 64 testPipe(messages: 1, transform: true);
64 testPipe(messages: 10, transform: false); 65 testPipe(messages: 10, transform: false);
65 testPipe(messages: 10, transform: true); 66 testPipe(messages: 10, transform: true);
66 } 67 }
OLDNEW
« no previous file with comments | « sdk/lib/io/websocket_impl.dart ('k') | tests/standalone/io/web_socket_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698