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

Side by Side Diff: pkg/analysis_server/test/domain_analysis_test.dart

Issue 1316753003: Ignore non-existent analysis roots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.domain.analysis; 5 library test.domain.analysis;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 resourceProvider.newFile(file, 'main() {}'); 88 resourceProvider.newFile(file, 'main() {}');
89 var response = testSetAnalysisRoots(['/project'], []); 89 var response = testSetAnalysisRoots(['/project'], []);
90 var serverRef = server; 90 var serverRef = server;
91 expect(response, isResponseSuccess('0')); 91 expect(response, isResponseSuccess('0'));
92 // verify that unit is resolved eventually 92 // verify that unit is resolved eventually
93 return server.onAnalysisComplete.then((_) { 93 return server.onAnalysisComplete.then((_) {
94 var units = serverRef.getResolvedCompilationUnits(file); 94 var units = serverRef.getResolvedCompilationUnits(file);
95 expect(units, hasLength(1)); 95 expect(units, hasLength(1));
96 }); 96 });
97 }); 97 });
98
99 test('nonexistent folder', () async {
100 String fileB = '/project_b/b.dart';
101 resourceProvider.newFile(fileB, '// b');
102 var response = testSetAnalysisRoots(['/project_a', '/project_b'], []);
103 var serverRef = server;
104 expect(response, isResponseSuccess('0'));
105 // Non-existence of /project_a should not prevent files in /project_b
106 // from being analyzed.
107 await server.onAnalysisComplete;
108 expect(serverRef.getResolvedCompilationUnits(fileB), hasLength(1));
109 });
98 }); 110 });
99 }); 111 });
100 112
101 group('setPriorityFiles', () { 113 group('setPriorityFiles', () {
102 test('invalid', () { 114 test('invalid', () {
103 // TODO(paulberry): under the "eventual consistency" model this request 115 // TODO(paulberry): under the "eventual consistency" model this request
104 // should not be invalid. 116 // should not be invalid.
105 var request = new AnalysisSetPriorityFilesParams(['/project/lib.dart']) 117 var request = new AnalysisSetPriorityFilesParams(['/project/lib.dart'])
106 .toRequest('0'); 118 .toRequest('0');
107 var response = handler.handleRequest(request); 119 var response = handler.handleRequest(request);
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 test_beforeAnalysis() async { 735 test_beforeAnalysis() async {
724 addTestFile('int V = 42;'); 736 addTestFile('int V = 42;');
725 createProject(); 737 createProject();
726 // subscribe 738 // subscribe
727 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile); 739 addAnalysisSubscription(AnalysisService.HIGHLIGHTS, testFile);
728 // wait for analysis 740 // wait for analysis
729 await waitForTasksFinished(); 741 await waitForTasksFinished();
730 expect(filesHighlights[testFile], isNotEmpty); 742 expect(filesHighlights[testFile], isNotEmpty);
731 } 743 }
732 } 744 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698