| 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 #library("StreamPipeTest"); | 10 #library("StreamPipeTest"); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 var tempDir = new Directory(''); | 89 var tempDir = new Directory(''); |
| 90 tempDir.createTempSync(); | 90 tempDir.createTempSync(); |
| 91 var dstFileName = tempDir.path + "/readline_test1.dat"; | 91 var dstFileName = tempDir.path + "/readline_test1.dat"; |
| 92 var dstFile = new File(dstFileName); | 92 var dstFile = new File(dstFileName); |
| 93 dstFile.createSync(); | 93 dstFile.createSync(); |
| 94 var fileOutput = dstFile.openOutputStream(); | 94 var fileOutput = dstFile.openOutputStream(); |
| 95 | 95 |
| 96 socketInput.closeHandler = () { | 96 socketInput.closeHandler = () { |
| 97 // Check that the resulting file is equal to the initial | 97 // Check that the resulting file is equal to the initial |
| 98 // file. | 98 // file. |
| 99 bool result = compareFileContent(srcFileName, dstFileName); | |
| 100 fileOutput.closeHandler = () { | 99 fileOutput.closeHandler = () { |
| 100 bool result = compareFileContent(srcFileName, dstFileName); |
| 101 new File(dstFileName).deleteSync(); | 101 new File(dstFileName).deleteSync(); |
| 102 tempDir.deleteSync(); | 102 tempDir.deleteSync(); |
| 103 Expect.isTrue(result); | 103 Expect.isTrue(result); |
| 104 | 104 |
| 105 _socket.close(); | 105 _socket.close(); |
| 106 | 106 |
| 107 // Run this twice. | 107 // Run this twice. |
| 108 if (count++ < 2) { | 108 if (count++ < 2) { |
| 109 runTest(); | 109 runTest(); |
| 110 } else { | 110 } else { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 srcStream.pipe(dstStream, close: false); | 286 srcStream.pipe(dstStream, close: false); |
| 287 } | 287 } |
| 288 | 288 |
| 289 | 289 |
| 290 main() { | 290 main() { |
| 291 testFileToFilePipe1(); | 291 testFileToFilePipe1(); |
| 292 testFileToFilePipe2(); | 292 testFileToFilePipe2(); |
| 293 testFileToFilePipe3(); | 293 testFileToFilePipe3(); |
| 294 PipeServerGame echoServerGame = new PipeServerGame.start(); | 294 PipeServerGame echoServerGame = new PipeServerGame.start(); |
| 295 } | 295 } |
| OLD | NEW |