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

Unified Diff: tests/language/vm/causal_async_exception_stack_test.dart

Issue 2646443005: Track async causal stack traces (Closed)
Patch Set: rebase Created 3 years, 10 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: tests/language/vm/causal_async_exception_stack_test.dart
diff --git a/tests/language/vm/causal_async_exception_stack_test.dart b/tests/language/vm/causal_async_exception_stack_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5e8eee0061fb72b969dfb62e854af83bdae0f8a2
--- /dev/null
+++ b/tests/language/vm/causal_async_exception_stack_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:unittest/unittest.dart';
+
+thrower() async {
+ throw 'oops';
+}
+
+number() async {
+ return 4;
+}
+
+generator() async* {
+ yield await number();
+ yield await thrower();
+}
+
+foo() async {
+ await for (var i in generator()) {
+ print(i);
+ }
+}
+
+main() async {
+ try {
+ await foo();
+ } catch (e, st) {
+ expect(st.toString(), stringContainsInOrder([
+ 'thrower.<thrower_async_body>',
+ '<asynchronous suspension>',
+ 'thrower',
+ 'generator.<generator_async_gen_body>',
+ '<asynchronous suspension>',
+ 'generator',
+ 'foo.<foo_async_body>',
+ '<asynchronous suspension>',
+ ]));
+ }
+}
« no previous file with comments | « tests/language/vm/async_await_catch_stacktrace_test.dart ('k') | tests/standalone/dart_developer_disabled_env_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698