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

Side by Side Diff: tests/standalone/src/StreamPipeTest.dart

Issue 9568006: Missing handling of default arguments in socket stream readInto (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // 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 #library("StreamPipeTest");
11 #import("dart:io"); 10 #import("dart:io");
12 #import("dart:isolate"); 11 #import("dart:isolate");
13 #source("TestingServer.dart"); 12 #source("TestingServer.dart");
14 13
15 // Helper method to be able to run the test from the runtime 14 // Helper method to be able to run the test from the runtime
16 // directory, or the top directory. 15 // directory, or the top directory.
17 String getDataFilename(String path) => 16 String getDataFilename(String path) =>
18 new File(path).existsSync() ? path : '../' + path; 17 new File(path).existsSync() ? path : '../' + path;
19 18
20 19
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 ReceivePort _receivePort; 144 ReceivePort _receivePort;
146 SendPort _sendPort; 145 SendPort _sendPort;
147 Socket _socket; 146 Socket _socket;
148 int _messages; 147 int _messages;
149 } 148 }
150 149
151 150
152 // The testing server will simply pipe each connecting sockets input 151 // The testing server will simply pipe each connecting sockets input
153 // stream to its output stream. 152 // stream to its output stream.
154 class PipeServer extends TestingServer { 153 class PipeServer extends TestingServer {
155 void connectionHandler(Socket connection) { 154 void onConnection(Socket connection) {
156 connection.onError = () { Expect.fail("Socket error"); }; 155 connection.onError = () { Expect.fail("Socket error"); };
157 connection.inputStream.pipe(connection.outputStream); 156 connection.inputStream.pipe(connection.outputStream);
158 } 157 }
159 } 158 }
160 159
161 160
162 // Test piping from one file to another and closing both streams 161 // Test piping from one file to another and closing both streams
163 // after wards. 162 // after wards.
164 testFileToFilePipe1() { 163 testFileToFilePipe1() {
165 // Force test to timeout if one of the handlers is 164 // Force test to timeout if one of the handlers is
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 srcStream.pipe(dstStream, close: false); 285 srcStream.pipe(dstStream, close: false);
287 } 286 }
288 287
289 288
290 main() { 289 main() {
291 testFileToFilePipe1(); 290 testFileToFilePipe1();
292 testFileToFilePipe2(); 291 testFileToFilePipe2();
293 testFileToFilePipe3(); 292 testFileToFilePipe3();
294 PipeServerGame echoServerGame = new PipeServerGame.start(); 293 PipeServerGame echoServerGame = new PipeServerGame.start();
295 } 294 }
OLDNEW
« no previous file with comments | « tests/standalone/src/SocketManyConnectionsTest.dart ('k') | tests/standalone/src/TestingServer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698