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

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

Issue 63603005: Properly parse jsshell and d8 stack frames. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 7 years, 1 month 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/lib/src/frame.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/frame_test.dart
diff --git a/pkg/stack_trace/test/frame_test.dart b/pkg/stack_trace/test/frame_test.dart
index 97cf48a220c7cd7b2f8eae37863816d36184a0b9..87a8c4dc777c90db098f45d75e82516f15a6c08c 100644
--- a/pkg/stack_trace/test/frame_test.dart
+++ b/pkg/stack_trace/test/frame_test.dart
@@ -72,6 +72,52 @@ void main() {
expect(frame.member, equals('VW.call\$0'));
});
+ test('parses a stack frame with an absolute POSIX path correctly', () {
+ var frame = new Frame.parseV8(" at VW.call\$0 "
+ "(/path/to/stuff.dart.js:560:28)");
+ expect(frame.uri, equals(Uri.parse("file:///path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, equals(28));
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with an absolute Windows path correctly', () {
+ var frame = new Frame.parseV8(" at VW.call\$0 "
+ r"(C:\path\to\stuff.dart.js:560:28)");
+ expect(frame.uri, equals(Uri.parse("file:///C:/path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, equals(28));
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with a Windows UNC path correctly', () {
+ var frame = new Frame.parseV8(" at VW.call\$0 "
+ r"(\\mount\path\to\stuff.dart.js:560:28)");
+ expect(frame.uri,
+ equals(Uri.parse("file://mount/path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, equals(28));
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with a relative POSIX path correctly', () {
+ var frame = new Frame.parseV8(" at VW.call\$0 "
+ "(path/to/stuff.dart.js:560:28)");
+ expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, equals(28));
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with a relative Windows path correctly', () {
+ var frame = new Frame.parseV8(" at VW.call\$0 "
+ r"(path\to\stuff.dart.js:560:28)");
+ expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, equals(28));
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
test('parses an anonymous stack frame correctly', () {
var frame = new Frame.parseV8(
" at http://pub.dartlang.org/stuff.dart.js:560:28");
@@ -135,6 +181,52 @@ void main() {
expect(frame.member, equals('VW.call\$0'));
});
+ test('parses a stack frame with an absolute POSIX path correctly', () {
+ var frame = new Frame.parseFirefox(
+ ".VW.call\$0@/path/to/stuff.dart.js:560");
+ expect(frame.uri, equals(Uri.parse("file:///path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, isNull);
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with an absolute Windows path correctly', () {
+ var frame = new Frame.parseFirefox(
+ r".VW.call$0@C:\path\to\stuff.dart.js:560");
+ expect(frame.uri, equals(Uri.parse("file:///C:/path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, isNull);
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with a Windows UNC path correctly', () {
+ var frame = new Frame.parseFirefox(
+ r".VW.call$0@\\mount\path\to\stuff.dart.js:560");
+ expect(frame.uri,
+ equals(Uri.parse("file://mount/path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, isNull);
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with a relative POSIX path correctly', () {
+ var frame = new Frame.parseFirefox(
+ ".VW.call\$0@path/to/stuff.dart.js:560");
+ expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, isNull);
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
+ test('parses a stack frame with a relative Windows path correctly', () {
+ var frame = new Frame.parseFirefox(
+ r".VW.call$0@path\to\stuff.dart.js:560");
+ expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js")));
+ expect(frame.line, equals(560));
+ expect(frame.column, isNull);
+ expect(frame.member, equals('VW.call\$0'));
+ });
+
test('parses a simple anonymous stack frame correctly', () {
var frame = new Frame.parseFirefox(
"@http://pub.dartlang.org/stuff.dart.js:560");
« no previous file with comments | « pkg/stack_trace/lib/src/frame.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698