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

Unified Diff: tests/standalone/src/StreamPipeTest.dart

Issue 9494003: Wait for output file to close before deleting the file in pipe test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/StreamPipeTest.dart
diff --git a/tests/standalone/src/StreamPipeTest.dart b/tests/standalone/src/StreamPipeTest.dart
index e3779d400e4fdcaa853b6071669d8233035a3ad7..c38fa56e1c0e7b4635ad96b57c5591a7b859f0cb 100644
--- a/tests/standalone/src/StreamPipeTest.dart
+++ b/tests/standalone/src/StreamPipeTest.dart
@@ -97,18 +97,20 @@ class PipeServerGame {
// Check that the resulting file is equal to the initial
// file.
bool result = compareFileContent(srcFileName, dstFileName);
- new File(dstFileName).deleteSync();
- tempDir.deleteSync();
- Expect.isTrue(result);
-
- _socket.close();
-
- // Run this twice.
- if (count++ < 2) {
- runTest();
- } else {
- shutdown();
- }
+ fileOutput.closeHandler = () {
+ new File(dstFileName).deleteSync();
+ tempDir.deleteSync();
+ Expect.isTrue(result);
+
+ _socket.close();
+
+ // Run this twice.
+ if (count++ < 2) {
+ runTest();
+ } else {
+ shutdown();
+ }
+ };
};
socketInput.pipe(fileOutput);
« 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