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

Unified Diff: pkg/front_end/test/dependency_grapher_test.dart

Issue 2979003002: support resolving .packages in FE (Closed)
Patch Set: cl comments Created 3 years, 5 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 | « pkg/front_end/messages.yaml ('k') | pkg/front_end/test/fasta/uri_translator_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/dependency_grapher_test.dart
diff --git a/pkg/front_end/test/dependency_grapher_test.dart b/pkg/front_end/test/dependency_grapher_test.dart
index bc1a4729722dbfd4187fc515e5982e7b99fbfc4a..d3fefa39eb2d040e635049e54142a59c28fa238c 100644
--- a/pkg/front_end/test/dependency_grapher_test.dart
+++ b/pkg/front_end/test/dependency_grapher_test.dart
@@ -31,11 +31,14 @@ class DependencyGrapherTest {
}
Future<List<LibraryCycleNode>> getCycles(Map<String, String> contents,
- {List<String> startingPoints, String packagesFilePath = ''}) async {
+ {List<String> startingPoints, String packagesFilePath}) async {
// If no starting points given, assume the first entry in [contents] is the
// single starting point.
startingPoints ??= [contents.keys.first];
var fileSystem = new MemoryFileSystem(Uri.parse('file:///'));
+ if (packagesFilePath == null) {
+ fileSystem.entityForUri(Uri.parse('.packages')).writeAsStringSync('');
+ }
contents.forEach((path, text) {
fileSystem.entityForUri(pathos.posix.toUri(path)).writeAsStringSync(text);
});
@@ -43,8 +46,8 @@ class DependencyGrapherTest {
var options = new CompilerOptions()
..fileSystem = fileSystem
..chaseDependencies = true
- ..packagesFileUri = packagesFilePath == ''
- ? new Uri()
+ ..packagesFileUri = packagesFilePath == null
+ ? Uri.parse('.packages')
: pathos.posix.toUri(packagesFilePath);
var graph = await graphForProgram(
startingPoints.map(pathos.posix.toUri).toList(), options);
« no previous file with comments | « pkg/front_end/messages.yaml ('k') | pkg/front_end/test/fasta/uri_translator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698