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

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

Issue 9505002: Do not compare the output before we know it has all been written. (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
« no previous file with comments | « no previous file | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698