| 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 // 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("dart:io"); | 10 #import("dart:io"); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 _sendPort = spawnFunction(startPipeServer); | 71 _sendPort = spawnFunction(startPipeServer); |
| 72 initialize(); | 72 initialize(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void runTest() { | 75 void runTest() { |
| 76 | 76 |
| 77 void connectHandler() { | 77 void connectHandler() { |
| 78 String srcFileName = | 78 String srcFileName = |
| 79 getDataFilename("tests/standalone/io/readline_test1.dat"); | 79 getDataFilename("tests/standalone/io/readline_test1.dat"); |
| 80 | 80 |
| 81 SocketOutputStream socketOutput = _socket.outputStream; | 81 OutputStream socketOutput = _socket.outputStream; |
| 82 InputStream fileInput = new File(srcFileName).openInputStream(); | 82 InputStream fileInput = new File(srcFileName).openInputStream(); |
| 83 | 83 |
| 84 fileInput.onClosed = () { | 84 fileInput.onClosed = () { |
| 85 SocketInputStream socketInput = _socket.inputStream; | 85 InputStream socketInput = _socket.inputStream; |
| 86 var tempDir = new Directory('').createTempSync(); | 86 var tempDir = new Directory('').createTempSync(); |
| 87 var dstFileName = tempDir.path.concat("/readline_test1.dat"); | 87 var dstFileName = tempDir.path.concat("/readline_test1.dat"); |
| 88 var dstFile = new File(dstFileName); | 88 var dstFile = new File(dstFileName); |
| 89 dstFile.createSync(); | 89 dstFile.createSync(); |
| 90 var fileOutput = dstFile.openOutputStream(); | 90 var fileOutput = dstFile.openOutputStream(); |
| 91 | 91 |
| 92 socketInput.onClosed = () { | 92 socketInput.onClosed = () { |
| 93 // Check that the resulting file is equal to the initial | 93 // Check that the resulting file is equal to the initial |
| 94 // file. | 94 // file. |
| 95 fileOutput.onClosed = () { | 95 fileOutput.onClosed = () { |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 srcStream.pipe(dstStream, close: false); | 285 srcStream.pipe(dstStream, close: false); |
| 286 } | 286 } |
| 287 | 287 |
| 288 | 288 |
| 289 main() { | 289 main() { |
| 290 testFileToFilePipe1(); | 290 testFileToFilePipe1(); |
| 291 testFileToFilePipe2(); | 291 testFileToFilePipe2(); |
| 292 testFileToFilePipe3(); | 292 testFileToFilePipe3(); |
| 293 PipeServerGame echoServerGame = new PipeServerGame.start(); | 293 PipeServerGame echoServerGame = new PipeServerGame.start(); |
| 294 } | 294 } |
| OLD | NEW |