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

Unified Diff: lib/src/utils.dart

Issue 1116443002: Support future matchers and expectAsync in tearDowns. (Closed) Base URL: git@github.com:dart-lang/unittest.git@master
Patch Set: Created 5 years, 8 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
Index: lib/src/utils.dart
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index f236814aa7a902cfe79a74a67f269a4c4d81cf72..9b6fd099d51d45ea969cf8bed333ece10d8ed8bb 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -139,6 +139,16 @@ StreamSink mapSink(StreamSink original, fn(event)) {
return controller.sink;
}
+/// Like [runZoned], but [zoneValues] are set for the callbacks in
+/// [zoneSpecification] and [onError].
+runZonedWithValues(Function body(), {Map zoneValues,
+ ZoneSpecification zoneSpecification, Function onError}) {
+ return runZoned(() {
+ return runZoned(body,
+ zoneSpecification: zoneSpecification, onError: onError);
+ }, zoneValues: zoneValues);
+}
+
/// Truncates [text] to fit within [maxLength].
///
/// This will try to truncate along word boundaries and preserve words both at

Powered by Google App Engine
This is Rietveld 408576698