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

Unified Diff: pkg/unittest/lib/src/test_case.dart

Issue 21905005: pkg/unittest: get stackTrace from error directly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: delegating TODO Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/test_case.dart
diff --git a/pkg/unittest/lib/src/test_case.dart b/pkg/unittest/lib/src/test_case.dart
index 75e126c9a2b1f0ef73ebc6943e7c7170c68c5193..d9650825bab97682cadaf3a52648d7e4c2eaf463 100644
--- a/pkg/unittest/lib/src/test_case.dart
+++ b/pkg/unittest/lib/src/test_case.dart
@@ -68,7 +68,14 @@ class TestCase {
bool get isComplete => !enabled || result != null;
Function _errorHandler(String stage) => (e) {
- var stack = getAttachedStackTrace(e);
+ var stack;
+ // TODO(kevmoo): Ideally, getAttachedStackTrace should handle Error as well?
+ // https://code.google.com/p/dart/issues/detail?id=12240
+ if(e is Error) {
+ stack = e.stackTrace;
+ } else {
+ stack = getAttachedStackTrace(e);
+ }
if (result == null || result == PASS) {
if (e is TestFailure) {
fail("$e", stack);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698