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

Side by Side Diff: pkg/stack_trace/test/frame_test.dart

Issue 28783006: Properly parse friendly stack traces without columns. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Firefox fixes Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « pkg/stack_trace/lib/src/trace.dart ('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:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 var frame = new Frame.parseFirefox( 195 var frame = new Frame.parseFirefox(
196 '.foo(12, "@)()/<")/.fn<@' 196 '.foo(12, "@)()/<")/.fn<@'
197 'http://pub.dartlang.org/stuff.dart.js:560'); 197 'http://pub.dartlang.org/stuff.dart.js:560');
198 expect(frame.uri, 198 expect(frame.uri,
199 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js"))); 199 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js")));
200 expect(frame.line, equals(560)); 200 expect(frame.line, equals(560));
201 expect(frame.column, isNull); 201 expect(frame.column, isNull);
202 expect(frame.member, equals("foo.<fn>")); 202 expect(frame.member, equals("foo.<fn>"));
203 }); 203 });
204 204
205 test('parses a deeply-nested anonymous stack frame with parameters '
206 'correctly', () {
207 var frame = new Frame.parseFirefox(
208 '.convertDartClosureToJS/\$function</<@'
209 'http://pub.dartlang.org/stuff.dart.js:560');
210 expect(frame.uri,
211 equals(Uri.parse("http://pub.dartlang.org/stuff.dart.js")));
212 expect(frame.line, equals(560));
213 expect(frame.column, isNull);
214 expect(frame.member, equals("convertDartClosureToJS.<fn>.<fn>"));
215 });
216
205 test('throws a FormatException for malformed frames', () { 217 test('throws a FormatException for malformed frames', () {
206 expect(() => new Frame.parseFirefox(''), throwsFormatException); 218 expect(() => new Frame.parseFirefox(''), throwsFormatException);
207 expect(() => new Frame.parseFirefox('.foo'), throwsFormatException); 219 expect(() => new Frame.parseFirefox('.foo'), throwsFormatException);
208 expect(() => new Frame.parseFirefox('.foo@dart:async/future.dart'), 220 expect(() => new Frame.parseFirefox('.foo@dart:async/future.dart'),
209 throwsFormatException); 221 throwsFormatException);
210 expect(() => new Frame.parseFirefox('.foo(@dart:async/future.dart:10'), 222 expect(() => new Frame.parseFirefox('.foo(@dart:async/future.dart:10'),
211 throwsFormatException); 223 throwsFormatException);
212 expect(() => new Frame.parseFirefox('@dart:async/future.dart'), 224 expect(() => new Frame.parseFirefox('@dart:async/future.dart'),
213 throwsFormatException); 225 throwsFormatException);
214 }); 226 });
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 equals('http://dartlang.org/thing.dart 5:10 in Foo')); 328 equals('http://dartlang.org/thing.dart 5:10 in Foo'));
317 }); 329 });
318 330
319 test('converts "<anonymous closure>" to "<fn>"', () { 331 test('converts "<anonymous closure>" to "<fn>"', () {
320 expect(new Frame.parseVM('#0 Foo.<anonymous closure> ' 332 expect(new Frame.parseVM('#0 Foo.<anonymous closure> '
321 '(dart:core/uri.dart:5:10)').toString(), 333 '(dart:core/uri.dart:5:10)').toString(),
322 equals('dart:core/uri.dart 5:10 in Foo.<fn>')); 334 equals('dart:core/uri.dart 5:10 in Foo.<fn>'));
323 }); 335 });
324 }); 336 });
325 } 337 }
OLDNEW
« no previous file with comments | « pkg/stack_trace/lib/src/trace.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698