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

Unified Diff: pkg/stack_trace/test/chain_test.dart

Issue 344953002: Properly handle synchronous errors in Chain.capture. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 6 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/stack_trace/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/test/chain_test.dart
diff --git a/pkg/stack_trace/test/chain_test.dart b/pkg/stack_trace/test/chain_test.dart
index 3347deb2b52da0233b146dd7a21b3b3afdf1a883..beb4721cf558d25e0a6fdb15856da74cf8844ae7 100644
--- a/pkg/stack_trace/test/chain_test.dart
+++ b/pkg/stack_trace/test/chain_test.dart
@@ -14,6 +14,15 @@ import 'utils.dart';
void main() {
group('capture() with onError catches exceptions', () {
+ test('thrown synchronously', () {
+ return captureFuture(() => throw 'error')
+ .then((chain) {
+ expect(chain.traces, hasLength(1));
+ expect(chain.traces.single.frames.first,
+ frameMember(startsWith('main')));
+ });
+ });
+
test('thrown in a microtask', () {
return captureFuture(() => inMicrotask(() => throw 'error'))
.then((chain) {
« no previous file with comments | « pkg/stack_trace/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698