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

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: Code review changes 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
« no previous file with comments | « pkg/scheduled_test/lib/src/schedule_error.dart ('k') | pkg/scheduled_test/lib/src/task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..83609f552517ec5ccde001d1788dd90aa9967c64 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,15 @@ 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 {
+ expect(value, _matcher);
+ } catch (e, stackTrace) {
+ throw new AsyncError(e, outerTrace);
+ }
}), description);
return true;
« no previous file with comments | « pkg/scheduled_test/lib/src/schedule_error.dart ('k') | pkg/scheduled_test/lib/src/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698