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

Unified Diff: pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart

Issue 93143002: Make pkg/stack_trace use stack chains. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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
Index: pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
diff --git a/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart b/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
index 1b377ae7f6e76e30065f065499906ed29eb706c9..6d8705bd230c9ec984854f6a66e362f27eee20a2 100644
--- a/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
+++ b/pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart
@@ -8,6 +8,7 @@ import 'dart:async';
import 'dart:io';
import 'package:path/path.dart' as path;
+import 'package:stack_trace/stack_trace.dart';
import '../../descriptor.dart';
import '../../scheduled_test.dart';
@@ -26,7 +27,8 @@ class DirectoryDescriptor extends Descriptor implements LoadableDescriptor {
Future create([String parent]) => schedule(() {
if (parent == null) parent = defaultRoot;
var fullPath = path.join(parent, name);
- return new Directory(fullPath).create(recursive: true).then((_) {
+ return Chain.track(new Directory(fullPath).create(recursive: true))
+ .then((_) {
return Future.wait(
contents.map((entry) => entry.create(fullPath)).toList());
});
@@ -43,7 +45,7 @@ class DirectoryDescriptor extends Descriptor implements LoadableDescriptor {
}
return Future.wait(contents.map((entry) {
- return new Future.sync(() => entry.validateNow(fullPath))
+ return syncFuture(() => entry.validateNow(fullPath))
.then((_) => null)
.catchError((e) => e);
})).then((results) {
@@ -54,7 +56,7 @@ class DirectoryDescriptor extends Descriptor implements LoadableDescriptor {
}
Stream<List<int>> load(String pathToLoad) {
- return futureStream(new Future.value().then((_) {
+ return futureStream(syncFuture(() {
if (path.posix.isAbsolute(pathToLoad)) {
throw new ArgumentError("Can't load absolute path '$pathToLoad'.");
}
« no previous file with comments | « pkg/scheduled_test/lib/scheduled_test.dart ('k') | pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698