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

Side by Side Diff: test/frame_test.dart

Issue 1288573002: Properly parse native-code V8 frames. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library frame_test; 5 library frame_test;
6 6
7 import 'package:path/path.dart' as path; 7 import 'package:path/path.dart' as path;
8 import 'package:stack_trace/stack_trace.dart'; 8 import 'package:stack_trace/stack_trace.dart';
9 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
10 10
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 test('parses an anonymous stack frame correctly', () { 142 test('parses an anonymous stack frame correctly', () {
143 var frame = new Frame.parseV8( 143 var frame = new Frame.parseV8(
144 " at http://pub.dartlang.org/stuff.dart.js:560:28"); 144 " at http://pub.dartlang.org/stuff.dart.js:560:28");
145 expect(frame.uri, 145 expect(frame.uri,
146 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); 146 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js")));
147 expect(frame.line, equals(560)); 147 expect(frame.line, equals(560));
148 expect(frame.column, equals(28)); 148 expect(frame.column, equals(28));
149 expect(frame.member, equals('<fn>')); 149 expect(frame.member, equals('<fn>'));
150 }); 150 });
151 151
152 test('parses a native stack frame correctly', () {
153 var frame = new Frame.parseV8(
154 " at Object.stringify (native)");
155 expect(frame.uri, Uri.parse('native'));
156 expect(frame.line, isNull);
157 expect(frame.column, isNull);
158 expect(frame.member, equals('Object.stringify'));
159 });
160
152 test('parses a stack frame with [as ...] correctly', () { 161 test('parses a stack frame with [as ...] correctly', () {
153 // Ignore "[as ...]", since other stack trace formats don't support a 162 // Ignore "[as ...]", since other stack trace formats don't support a
154 // similar construct. 163 // similar construct.
155 var frame = new Frame.parseV8(" at VW.call\$0 [as call\$4] " 164 var frame = new Frame.parseV8(" at VW.call\$0 [as call\$4] "
156 "(http://pub.dartlang.org/stuff.dart.js:560:28)"); 165 "(http://pub.dartlang.org/stuff.dart.js:560:28)");
157 expect(frame.uri, 166 expect(frame.uri,
158 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); 167 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js")));
159 expect(frame.line, equals(560)); 168 expect(frame.line, equals(560));
160 expect(frame.column, equals(28)); 169 expect(frame.column, equals(28));
161 expect(frame.member, equals('VW.call\$0')); 170 expect(frame.member, equals('VW.call\$0'));
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 equals('dart:core/uri.dart 5 in Foo')); 555 equals('dart:core/uri.dart 5 in Foo'));
547 }); 556 });
548 557
549 test('prints relative paths as relative', () { 558 test('prints relative paths as relative', () {
550 var relative = path.normalize('relative/path/to/foo.dart'); 559 var relative = path.normalize('relative/path/to/foo.dart');
551 expect(new Frame.parseFriendly('$relative 5:10 Foo').toString(), 560 expect(new Frame.parseFriendly('$relative 5:10 Foo').toString(),
552 equals('$relative 5:10 in Foo')); 561 equals('$relative 5:10 in Foo'));
553 }); 562 });
554 }); 563 });
555 } 564 }
OLDNEW
« 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