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

Unified Diff: pkg/scheduled_test/lib/src/schedule.dart

Issue 13839023: Add flag to disable capturing stack traces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/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 88c26eb1539421ce86b6caa09a822d3d6d4b78bb..451c994569ed5aad70dd5db106aa5b7dcb5cbb59 100644
--- a/pkg/scheduled_test/lib/src/schedule.dart
+++ b/pkg/scheduled_test/lib/src/schedule.dart
@@ -12,6 +12,7 @@ import 'package:unittest/unittest.dart' as unittest;
import 'mock_clock.dart' as mock_clock;
import 'schedule_error.dart';
+import '../scheduled_test.dart' show captureStackTraces;
import 'substitute_future.dart';
import 'task.dart';
import 'utils.dart';
@@ -309,7 +310,7 @@ class Schedule {
/// are no duplicate errors, and that all errors are wrapped in
/// [ScheduleError].
void _addError(error) {
- if (errors.contains(error)) return;
+ if (error is ScheduleError && errors.contains(error)) return;
errors.add(new ScheduleError.from(this, error));
}
}
@@ -496,8 +497,12 @@ 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";
+
+ if (captureStackTraces) {
+ var stackString = prefixLines(terseTraceString(new Trace.current()));
+ description += "\n\nStack trace:\n$stackString";
+ }
+
_totalCallbacks++;
_pendingCallbacks.add(description);

Powered by Google App Engine
This is Rietveld 408576698