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

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

Issue 578993002: Unify parsing of Firefox and Safari stack traces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 3 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/test/frame_test.dart ('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/trace_test.dart
diff --git a/pkg/stack_trace/test/trace_test.dart b/pkg/stack_trace/test/trace_test.dart
index bc2db6b85975634c66207e63059dfe7ea6ee3294..17f9c22e946d539afaf80d7158655ce22df1f292 100644
--- a/pkg/stack_trace/test/trace_test.dart
+++ b/pkg/stack_trace/test/trace_test.dart
@@ -92,7 +92,7 @@ void main() {
equals(Uri.parse("http://pub.dartlang.org/thing.js")));
});
- test('parses a Firefox stack trace correctly', () {
+ test('parses a Firefox/Safari stack trace correctly', () {
var trace = new Trace.parse(
'Foo._bar@http://pub.dartlang.org/stuff.js:42\n'
'zip/<@http://pub.dartlang.org/stuff.js:0\n'
@@ -130,7 +130,8 @@ void main() {
equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
});
- test('parses a Safari 6.0 stack trace correctly', () {
+ test('parses a Firefox/Safari stack trace containing native code correctly',
+ () {
var trace = new Trace.parse(
'Foo._bar@http://pub.dartlang.org/stuff.js:42\n'
'zip/<@http://pub.dartlang.org/stuff.js:0\n'
@@ -146,29 +147,49 @@ void main() {
expect(trace.frames.length, equals(3));
});
- test('parses a Safari 6.1 stack trace correctly', () {
+ test('parses a Firefox/Safari stack trace without a method name correctly',
+ () {
var trace = new Trace.parse(
- 'http://pub.dartlang.org/stuff.js:42:43\n'
- 'zip@http://pub.dartlang.org/stuff.js:0:1\n'
- 'zip\$zap@http://pub.dartlang.org/thing.js:1:2');
+ 'http://pub.dartlang.org/stuff.js:42\n'
+ 'zip/<@http://pub.dartlang.org/stuff.js:0\n'
+ 'zip.zap(12, "@)()/<")@http://pub.dartlang.org/thing.js:1');
expect(trace.frames[0].uri,
equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
+ expect(trace.frames[0].member, equals('<fn>'));
expect(trace.frames[1].uri,
equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
expect(trace.frames[2].uri,
equals(Uri.parse("http://pub.dartlang.org/thing.js")));
});
- test('parses a Safari 6.1 stack trace with an empty line correctly', () {
+ test('parses a Firefox/Safari stack trace with an empty line correctly',
+ () {
var trace = new Trace.parse(
- 'http://pub.dartlang.org/stuff.js:42:43\n'
+ 'Foo._bar@http://pub.dartlang.org/stuff.js:42\n'
'\n'
- 'zip@http://pub.dartlang.org/stuff.js:0:1\n'
- 'zip\$zap@http://pub.dartlang.org/thing.js:1:2');
+ 'zip/<@http://pub.dartlang.org/stuff.js:0\n'
+ 'zip.zap(12, "@)()/<")@http://pub.dartlang.org/thing.js:1');
+
+ expect(trace.frames[0].uri,
+ equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
+ expect(trace.frames[1].uri,
+ equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
+ expect(trace.frames[2].uri,
+ equals(Uri.parse("http://pub.dartlang.org/thing.js")));
+ });
+
+ test('parses a Firefox/Safari stack trace with a column number correctly',
+ () {
+ var trace = new Trace.parse(
+ 'Foo._bar@http://pub.dartlang.org/stuff.js:42:2\n'
+ 'zip/<@http://pub.dartlang.org/stuff.js:0\n'
+ 'zip.zap(12, "@)()/<")@http://pub.dartlang.org/thing.js:1');
expect(trace.frames[0].uri,
equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
+ expect(trace.frames[0].line, equals(42));
+ expect(trace.frames[0].column, equals(2));
expect(trace.frames[1].uri,
equals(Uri.parse("http://pub.dartlang.org/stuff.js")));
expect(trace.frames[2].uri,
« no previous file with comments | « pkg/stack_trace/test/frame_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698