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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 11348288: Get archive creation working on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 8 years, 1 month 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 | « utils/tests/pub/pub.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 1e759a0f4df1d06b2fd6281008f1d1e5827cac52..56c298785f7e500e5d2f56ee27b7738c7a6de442 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -667,9 +667,7 @@ void ensureGit() {
});
}
-Future<Directory> _setUpSandbox() {
- return createTempDir();
-}
+Future<Directory> _setUpSandbox() => createTempDir();
Future _runScheduled(Directory parentDir, List<_ScheduledEvent> scheduled) {
if (scheduled == null) return new Future.immediate(null);
@@ -1154,8 +1152,9 @@ class TarFileDescriptor extends Descriptor {
* compresses them, and saves the result to [parentDir].
*/
Future<File> create(parentDir) {
+ // TODO(rnystrom): Use withTempDir().
var tempDir;
- return parentDir.createTemp().chain((_tempDir) {
+ return createTempDir().chain((_tempDir) {
tempDir = _tempDir;
return Futures.wait(contents.map((child) => child.create(tempDir)));
}).chain((createdContents) {
@@ -1189,15 +1188,16 @@ class TarFileDescriptor extends Descriptor {
var sinkStream = new ListInputStream();
var tempDir;
+ // TODO(rnystrom): Use withTempDir() here.
// TODO(nweiz): propagate any errors to the return value. See issue 3657.
createTempDir().chain((_tempDir) {
tempDir = _tempDir;
return create(tempDir);
}).then((tar) {
var sourceStream = tar.openInputStream();
- pipeInputToInput(sourceStream,
- sinkStream,
- () => tempDir.delete(recursive: true));
+ pipeInputToInput(sourceStream, sinkStream).then((_) {
+ tempDir.delete(recursive: true);
+ });
});
return sinkStream;
}
« no previous file with comments | « utils/tests/pub/pub.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698