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

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

Issue 22859009: Changes to how we handle fancy stacks: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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
Index: pkg/unittest/lib/unittest.dart
===================================================================
--- pkg/unittest/lib/unittest.dart (revision 26407)
+++ pkg/unittest/lib/unittest.dart (working copy)
@@ -852,10 +852,19 @@
*/
bool formatStacks = true;
-/** Returns a Trace object from a StackTrace object or a String. */
+/**
+ * A flag that controls whether we try to filter out irrelevant frames from
+ * the stack trace. Requires formatStacks to be set.
+ */
+bool filterStacks = true;
+
+/**
+ * Returns a Trace object from a StackTrace object or a String, or the
+ * unchanged input if formatStacks is false;
+ */
Trace _getTrace(stack) {
Trace trace;
- if (stack == null) return null;
+ if (stack == null || !formatStacks) return null;
if (stack is String) {
trace = new Trace.parse(stack);
} else if (stack is StackTrace) {
@@ -864,7 +873,7 @@
throw new Exception('Invalid stack type ${stack.runtimeType} for $stack.');
}
- if (!formatStacks) return trace;
+ if (!filterStacks) return trace;
// Format the stack trace by removing everything above TestCase._runTest,
// which is usually going to be irrelevant. Also fold together unittest and

Powered by Google App Engine
This is Rietveld 408576698