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

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

Issue 12545080: Fix Frame.location on Windows in pkg/stack_trace. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « no previous file | 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 66dee6ace134da046fa40920fabc2c32d17c0713..5c5a32ed985e35808fa23831f1d6de4f1ef120f5 100644
--- a/pkg/stack_trace/test/frame_test.dart
+++ b/pkg/stack_trace/test/frame_test.dart
@@ -4,6 +4,7 @@
library frame_test;
+import 'dart:io';
import 'dart:uri';
import 'package:pathos/path.dart' as path;
@@ -41,7 +42,7 @@ void main() {
// TODO(nweiz): use URL-style paths when such a thing exists.
var builder = new path.Builder(style: path.Style.posix);
expect(builder.basename(frame.uri.path), equals('frame_test.dart'));
- expect(frame.line, equals(15));
+ expect(frame.line, equals(16));
expect(frame.column, equals(5));
expect(frame.member, equals('getStackFrame'));
});
@@ -112,8 +113,8 @@ void main() {
});
test('returns the relative path for file URIs', () {
- var absolute = path.absolute(path.join('foo', 'bar.dart'));
- expect(new Frame.parse('#0 Foo (file://$absolute:0:0)').library,
+ var uri = _pathToFileUri(path.join('foo', 'bar.dart'));
+ expect(new Frame.parse('#0 Foo ($uri:0:0)').library,
equals(path.join('foo', 'bar.dart')));
});
});
@@ -124,8 +125,8 @@ void main() {
expect(new Frame.parse('#0 Foo '
'(http://dartlang.org/thing.dart:5:10)').location,
equals('http://dartlang.org/thing.dart 5:10'));
- var absolute = path.absolute(path.join('foo', 'bar.dart'));
- expect(new Frame.parse('#0 Foo (file://$absolute:1:2)').location,
+ var uri = _pathToFileUri(path.join('foo', 'bar.dart'));
+ expect(new Frame.parse('#0 Foo ($uri:1:2)').location,
equals('${path.join('foo', 'bar.dart')} 1:2'));
});
@@ -157,3 +158,9 @@ void main() {
});
});
}
+
+String _pathToFileUri(String pathString) {
+ pathString = path.absolute(pathString);
+ if (Platform.operatingSystem != 'windows') return 'file://$pathString';
+ return 'file:///${pathString.replaceAll("\\", "/")}';
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698