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

Unified Diff: pkg/scheduled_test/lib/src/scheduled_future_matchers.dart

Issue 13157004: Use the stack_trace library in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
diff --git a/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart b/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
index 4e1d0ffb469456a86899577eddf15689157a3f66..0af9fefa43063762dbfc53875206e3cccac4366d 100644
--- a/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
+++ b/pkg/scheduled_test/lib/src/scheduled_future_matchers.dart
@@ -6,6 +6,8 @@ library scheduled_future_matchers;
import 'dart:async';
+import 'package:stack_trace/stack_trace.dart';
+
import '../scheduled_test.dart';
/// Matches a [Future] that completes successfully with a value. Note that this
@@ -60,8 +62,14 @@ class _ScheduledCompletes extends BaseMatcher {
}
}
+ var outerTrace = new Trace.current();
currentSchedule.wrapFuture(item.then((value) {
- if (_matcher != null) expect(value, _matcher);
+ if (_matcher == null) return;
+ try {
Bob Nystrom 2013/04/01 17:30:49 Nit, but how about a blank line before the try?
nweiz 2013/04/01 20:46:03 Done.
+ expect(value, _matcher);
+ } catch (e, stackTrace) {
+ throw new AsyncError(e, outerTrace);
+ }
}), description);
return true;

Powered by Google App Engine
This is Rietveld 408576698