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

Unified Diff: test/frame_test.dart

Issue 912043002: Better suqpport for async VM frames. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 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
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/frame_test.dart
diff --git a/test/frame_test.dart b/test/frame_test.dart
index b132368ca20c91478ebe6b0fea886efc0747cfcc..638d1d7f6e75472fddb7c45e80eb43842820400d 100644
--- a/test/frame_test.dart
+++ b/test/frame_test.dart
@@ -30,6 +30,17 @@ void main() {
expect(frame.member, equals('Foo._bar'));
});
+ // This can happen with async stack traces. See issue 22009.
+ test('parses a stack frame without line or column correctly', () {
+ var frame = new Frame.parseVM("#1 Foo._bar "
+ "(file:///home/nweiz/code/stuff.dart)");
+ expect(frame.uri,
+ equals(Uri.parse("file:///home/nweiz/code/stuff.dart")));
+ expect(frame.line, isNull);
+ expect(frame.column, isNull);
+ expect(frame.member, equals('Foo._bar'));
+ });
+
test('converts "<anonymous closure>" to "<fn>"', () {
String parsedMember(String member) =>
new Frame.parseVM('#0 $member (foo:0:0)').member;
@@ -39,6 +50,18 @@ void main() {
equals('<fn>.<fn>.bar'));
});
+ test('converts "<<anonymous closure>_async_body>" to "<async>"', () {
+ var frame = new Frame.parseVM(
+ '#0 Foo.<<anonymous closure>_async_body> (foo:0:0)');
+ expect(frame.member, equals('Foo.<async>'));
+ });
+
+ test('converts "<<anonymous closure>_async_body>" to "<async>"', () {
+ var frame = new Frame.parseVM(
+ '#0 Foo.<<anonymous closure>_async_body> (foo:0:0)');
+ expect(frame.member, equals('Foo.<async>'));
+ });
+
test('parses a folded frame correctly', () {
var frame = new Frame.parseVM('...');
@@ -52,8 +75,6 @@ void main() {
expect(() => new Frame.parseVM(''), throwsFormatException);
expect(() => new Frame.parseVM('#1'), throwsFormatException);
expect(() => new Frame.parseVM('#1 Foo'), throwsFormatException);
- expect(() => new Frame.parseVM('#1 Foo (dart:async/future.dart)'),
- throwsFormatException);
expect(() => new Frame.parseVM('#1 (dart:async/future.dart:10:15)'),
throwsFormatException);
expect(() => new Frame.parseVM('Foo (dart:async/future.dart:10:15)'),
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698