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

Unified Diff: pkg/scheduled_test/lib/src/task.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/scheduled_future_matchers.dart ('k') | pkg/scheduled_test/lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/src/task.dart
diff --git a/pkg/scheduled_test/lib/src/task.dart b/pkg/scheduled_test/lib/src/task.dart
index 2ce3905517a2503d4766da0133bfb7ec15fb3524..4ccb201f5fbe85af5f5f3ac19a7fe26021075cea 100644
--- a/pkg/scheduled_test/lib/src/task.dart
+++ b/pkg/scheduled_test/lib/src/task.dart
@@ -7,6 +7,8 @@ library task;
import 'dart:async';
import 'dart:collection';
+import 'package:stack_trace/stack_trace.dart';
+
import 'future_group.dart';
import 'schedule.dart';
import 'utils.dart';
@@ -59,6 +61,8 @@ class Task {
Future get result => _resultCompleter.future;
final _resultCompleter = new Completer();
+ final stackTrace = new Trace.current();
+
Task(fn(), String description, TaskQueue queue)
: this._(fn, description, queue, null, queue.contents.length);
@@ -116,6 +120,11 @@ class Task {
String toString() => description == null ? "#$_id" : description;
+ String toStringWithStackTrace() {
+ var stackString = prefixLines(terseTraceString(stackTrace));
+ return "$this\n\nStack trace:\n$stackString";
+ }
+
/// Returns a detailed representation of [queue] with this task highlighted.
String generateTree() => queue.generateTree(this);
}
« no previous file with comments | « pkg/scheduled_test/lib/src/scheduled_future_matchers.dart ('k') | pkg/scheduled_test/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698