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

Unified Diff: pkg/analysis_server/test/analysis/set_priority_files_test.dart

Issue 1408163008: Fix for duplicate priority sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/analysis/set_priority_files_test.dart
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
index 8626ef8eb3d824dc20f2a1e9d8e4614faafe6169..e1df6f531d3927209e85ef4e751d1349aa847d92 100644
--- a/pkg/analysis_server/test/analysis/set_priority_files_test.dart
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -6,6 +6,9 @@ library test.analysis.set_priority_files;
import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analysis_server/src/domain_analysis.dart';
+import 'package:analyzer/src/generated/engine.dart'
+ show InternalAnalysisContext;
+import 'package:analyzer/src/generated/source.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'package:unittest/unittest.dart';
@@ -35,15 +38,30 @@ class SetPriorityFilesTest extends AbstractAnalysisTest {
test_fileInAnalysisRoot() async {
addTestFile('');
+ // wait for analysis to ensure that file is know to the context
Brian Wilkerson 2015/10/30 00:08:48 "file is know" --> "the file is known"
+ await server.onAnalysisComplete;
+ // set priority files
Response response = await _setPriorityFile(testFile);
expect(response, isResponseSuccess('0'));
+ // verify
+ InternalAnalysisContext context = server.getContainingContext(testFile);
+ List<Source> prioritySources = context.prioritySources;
+ expect(prioritySources, hasLength(1));
+ expect(prioritySources.first.fullName, testFile);
}
test_fileInSdk() async {
addTestFile('');
await server.onAnalysisComplete;
- Response response = await _setPriorityFile('/lib/convert/convert.dart');
+ // set priority files
+ String filePath = '/lib/convert/convert.dart';
+ Response response = await _setPriorityFile(filePath);
expect(response, isResponseSuccess('0'));
+ // verify
+ InternalAnalysisContext sdkContext = server.defaultSdk.context;
+ List<Source> prioritySources = sdkContext.prioritySources;
+ expect(prioritySources, hasLength(1));
+ expect(prioritySources.first.fullName, filePath);
}
test_fileNotInAnalysisRoot() async {
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698