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

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 26163)
+++ pkg/unittest/lib/unittest.dart (working copy)
@@ -850,10 +850,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 trce. 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;
+ */
nweiz 2013/08/14 23:56:59 This method is now typed incorrectly. See my comme
gram 2013/08/15 22:36:43 Done.
Trace _getTrace(stack) {
Trace trace;
- if (stack == null) return null;
+ if (stack == null || !formatStacks) return stack;
if (stack is String) {
trace = new Trace.parse(stack);
} else if (stack is StackTrace) {
@@ -862,7 +871,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