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

Unified Diff: pkg/scheduled_test/lib/src/schedule.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 | « no previous file | pkg/scheduled_test/lib/src/schedule_error.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/schedule.dart
diff --git a/pkg/scheduled_test/lib/src/schedule.dart b/pkg/scheduled_test/lib/src/schedule.dart
index 42c6fa296e723b6b2e0f8224a6ad442288f43675..88c26eb1539421ce86b6caa09a822d3d6d4b78bb 100644
--- a/pkg/scheduled_test/lib/src/schedule.dart
+++ b/pkg/scheduled_test/lib/src/schedule.dart
@@ -7,6 +7,7 @@ library schedule;
import 'dart:async';
import 'dart:collection';
+import 'package:stack_trace/stack_trace.dart';
import 'package:unittest/unittest.dart' as unittest;
import 'mock_clock.dart' as mock_clock;
@@ -495,6 +496,8 @@ class TaskQueue {
if (description == null) {
description = "Out-of-band operation #${_totalCallbacks}";
}
+ var stackString = prefixLines(terseTraceString(new Trace.current()));
+ description = "$description\n\nStack trace:\n$stackString";
_totalCallbacks++;
_pendingCallbacks.add(description);
@@ -558,7 +561,10 @@ class TaskQueue {
String generateTree([Task highlight]) {
assert(highlight == null || highlight.queue == this);
return _contents.map((task) {
- var taskString = prefixLines(task.toString(),
+ var taskString = task == highlight
+ ? task.toStringWithStackTrace()
+ : task.toString();
+ taskString = prefixLines(taskString,
firstPrefix: task == highlight ? "> " : "* ");
if (task == highlight && !task.children.isEmpty) {
@@ -570,7 +576,10 @@ class TaskQueue {
prefix = "*";
}
- return prefixLines(child.toString(),
+ var childString = prefix == "*"
+ ? child.toString()
+ : child.toStringWithStackTrace();
+ return prefixLines(childString,
firstPrefix: " $prefix ", prefix: " | ");
}).join('\n');
taskString = '$taskString\n$childrenString';
« no previous file with comments | « no previous file | pkg/scheduled_test/lib/src/schedule_error.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698