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

Unified Diff: pkg/front_end/test/src/base/uri_resolver_test.dart

Issue 2614063007: Use URIs rather than paths in front end API. (Closed)
Patch Set: Run dartfmt Created 3 years, 11 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
Index: pkg/front_end/test/src/base/uri_resolver_test.dart
diff --git a/pkg/front_end/test/src/base/uri_resolver_test.dart b/pkg/front_end/test/src/base/uri_resolver_test.dart
index 1273a1934480421b775138c019f7a2d089a8f7e0..af00240f74df357235dda45c54b7d52c3b534d7f 100644
--- a/pkg/front_end/test/src/base/uri_resolver_test.dart
+++ b/pkg/front_end/test/src/base/uri_resolver_test.dart
@@ -21,7 +21,7 @@ abstract class UriResolverTest {
p.Context get pathContext;
void test_badScheme() {
- _expectResolution('foo:bar/baz.dart', null);
+ _expectResolutionUri('foo:bar/baz.dart', Uri.parse('foo:bar/baz.dart'));
}
void test_dart() {
@@ -54,11 +54,11 @@ abstract class UriResolverTest {
}
void test_noSchemeAbsolute() {
- _expectResolution('/foo.dart', null);
+ _expectResolutionUri('/foo.dart', Uri.parse('/foo.dart'));
}
void test_noSchemeRelative() {
- _expectResolution('foo.dart', null);
+ _expectResolution('foo.dart', 'foo.dart');
}
void test_package() {
@@ -102,6 +102,13 @@ abstract class UriResolverTest {
/// Verifies that the resolution of [uriString] produces the path
/// [expectedResult].
void _expectResolution(String uriString, String expectedResult) {
+ _expectResolutionUri(uriString,
+ expectedResult == null ? null : pathContext.toUri(expectedResult));
+ }
+
+ /// Verifies that the resolution of [uriString] produces the URI
+ /// [expectedResult].
+ void _expectResolutionUri(String uriString, Uri expectedResult) {
var packages = {
'foo': _u('packages/foo/lib/'),
'bar': _u('packages/bar/lib/')
@@ -110,7 +117,7 @@ abstract class UriResolverTest {
'core': _u('sdk/lib/core/core.dart'),
'async': _u('sdk/lib/async/async.dart')
};
- var uriResolver = new UriResolver(packages, sdkLibraries, pathContext);
+ var uriResolver = new UriResolver(packages, sdkLibraries);
expect(uriResolver.resolve(Uri.parse(uriString)), expectedResult);
}

Powered by Google App Engine
This is Rietveld 408576698