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

Unified Diff: test/trace_test.dart

Issue 1062123003: Support JavaScriptCore stack traces. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Code review changes Created 5 years, 8 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/trace_test.dart
diff --git a/test/trace_test.dart b/test/trace_test.dart
index 18875096a7192a6d824c684f0a8645e22d517476..e8f749a22a5fec28780b5eee45f5aef49bfb5454 100644
--- a/test/trace_test.dart
+++ b/test/trace_test.dart
@@ -92,6 +92,23 @@ void main() {
equals(Uri.parse("http://pub.dartlang.org/thing.js")));
});
+ // JavaScriptCore traces are just like V8, except that it doesn't have a
+ // header and it starts with a tab rather than spaces.
+ test('parses a JavaScriptCore stack trace correctly', () {
+ var trace = new Trace.parse(
+ '\tat Foo._bar (http://pub.dartlang.org/stuff.js:42:21)\n'
+ '\tat http://pub.dartlang.org/stuff.js:0:2\n'
+ '\tat zip.<anonymous>.zap '
+ '(http://pub.dartlang.org/thing.js:1:100)');
+
+ 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 correctly', () {
var trace = new Trace.parse(
'Foo._bar@http://pub.dartlang.org/stuff.js:42\n'
« 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