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

Unified Diff: pkg/analysis_server/test/domain_analysis_test.dart

Issue 1491013002: Analysis request `getReachableSources` (#24893). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/analysis_server/test/domain_analysis_test.dart
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 640d2fdb697f3621b6d3f78041f702f5bca90496..6f57667682d788a65e3d3a6d97d54bb13da8e9b8 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -55,6 +55,27 @@ main() {
group('updateContent', testUpdateContent);
group('AnalysisDomainHandler', () {
+ test('getReachableSources', () async {
Brian Wilkerson 2015/12/02 01:56:27 Maybe put this in a group? Also test what happens
pquitslund 2015/12/02 16:40:22 Done.
+ String fileA = '/project/a.dart';
+ String fileB = '/project/b.dart';
+ resourceProvider.newFile(fileA, 'import "b.dart";');
+ resourceProvider.newFile(fileB, '');
+
+ server.setAnalysisRoots('0', ['/project/'], [], {});
+
+ await server.onAnalysisComplete;
+
+ var request = new AnalysisGetReachableSourcesParams(fileA).toRequest('0');
+ var response = handler.handleRequest(request);
+
+ var json = response.toJson()[Response.RESULT];
+
+ // Sanity checks.
+ expect(json['sources'], hasLength(6));
+ expect(json['sources']['file:///project/a.dart'],
+ unorderedEquals(['dart:core', 'file:///project/b.dart']));
Brian Wilkerson 2015/12/02 01:56:27 Perhaps verify that b.dart is a key in the map?
pquitslund 2015/12/02 16:40:22 Done.
+ });
+
group('setAnalysisRoots', () {
Response testSetAnalysisRoots(
List<String> included, List<String> excluded) {

Powered by Google App Engine
This is Rietveld 408576698