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

Unified Diff: pkg/front_end/test/src/base/processed_options_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/processed_options_test.dart
diff --git a/pkg/front_end/test/src/base/processed_options_test.dart b/pkg/front_end/test/src/base/processed_options_test.dart
index ff34028afb3a28f5e4016854996fbbc401cbcb11..76151dd0339b5c2aa303d5b1de50557bfca4aeae 100644
--- a/pkg/front_end/test/src/base/processed_options_test.dart
+++ b/pkg/front_end/test/src/base/processed_options_test.dart
@@ -17,7 +17,7 @@ main() {
@reflectiveTest
class ProcessedOptionsTest {
- final fileSystem = new MemoryFileSystem(pathos.posix, '/');
+ final fileSystem = new MemoryFileSystem(pathos.posix, Uri.parse('file:///'));
test_compileSdk_false() {
for (var value in [false, true]) {
@@ -37,46 +37,49 @@ class ProcessedOptionsTest {
test_getUriResolver_explicitPackagesFile() async {
// This .packages file should be ignored.
- fileSystem.entityForPath('/.packages').writeAsStringSync('foo:bar\n');
+ fileSystem
+ .entityForUri(Uri.parse('file:///.packages'))
+ .writeAsStringSync('foo:bar\n');
// This one should be used.
fileSystem
- .entityForPath('/explicit.packages')
+ .entityForUri(Uri.parse('file:///explicit.packages'))
.writeAsStringSync('foo:baz\n');
var raw = new CompilerOptions()
..fileSystem = fileSystem
- ..packagesFilePath = '/explicit.packages';
+ ..packagesFileUri = Uri.parse('file:///explicit.packages');
var processed = new ProcessedOptions(raw);
var uriResolver = await processed.getUriResolver();
expect(uriResolver.packages, {'foo': Uri.parse('file:///baz/')});
- expect(uriResolver.pathContext, same(fileSystem.context));
}
test_getUriResolver_explicitPackagesFile_withBaseLocation() async {
// This .packages file should be ignored.
- fileSystem.entityForPath('/.packages').writeAsStringSync('foo:bar\n');
+ fileSystem
+ .entityForUri(Uri.parse('file:///.packages'))
+ .writeAsStringSync('foo:bar\n');
// This one should be used.
fileSystem
- .entityForPath('/base/location/explicit.packages')
+ .entityForUri(Uri.parse('file:///base/location/explicit.packages'))
.writeAsStringSync('foo:baz\n');
var raw = new CompilerOptions()
..fileSystem = fileSystem
- ..packagesFilePath = '/base/location/explicit.packages';
+ ..packagesFileUri = Uri.parse('file:///base/location/explicit.packages');
var processed = new ProcessedOptions(raw);
var uriResolver = await processed.getUriResolver();
expect(
uriResolver.packages, {'foo': Uri.parse('file:///base/location/baz/')});
- expect(uriResolver.pathContext, same(fileSystem.context));
}
test_getUriResolver_noPackages() async {
// .packages file should be ignored.
- fileSystem.entityForPath('/.packages').writeAsStringSync('foo:bar\n');
+ fileSystem
+ .entityForUri(Uri.parse('file:///.packages'))
+ .writeAsStringSync('foo:bar\n');
var raw = new CompilerOptions()
..fileSystem = fileSystem
- ..packagesFilePath = '';
+ ..packagesFileUri = new Uri();
var processed = new ProcessedOptions(raw);
var uriResolver = await processed.getUriResolver();
expect(uriResolver.packages, isEmpty);
- expect(uriResolver.pathContext, same(fileSystem.context));
}
}

Powered by Google App Engine
This is Rietveld 408576698